photoprism/pkg/rnd/bytes_test.go
Michael Mayer b32a970aab Auth: Add RandomBytes() to generate secure random bytes #98 #782
Signed-off-by: Michael Mayer <michael@photoprism.app>
2022-09-28 13:38:08 +02:00

17 lines
253 B
Go

package rnd
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestRandomBytes(t *testing.T) {
for n := 0; n <= 64; n++ {
if result, err := RandomBytes(n); err != nil {
t.Fatal(err)
} else {
assert.Len(t, result, n)
}
}
}