diff options
Diffstat (limited to 'v_windows/v/vlib/crypto/rand/crypto_rand_read_test.v')
-rw-r--r-- | v_windows/v/vlib/crypto/rand/crypto_rand_read_test.v | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/v_windows/v/vlib/crypto/rand/crypto_rand_read_test.v b/v_windows/v/vlib/crypto/rand/crypto_rand_read_test.v new file mode 100644 index 0000000..824923d --- /dev/null +++ b/v_windows/v/vlib/crypto/rand/crypto_rand_read_test.v @@ -0,0 +1,15 @@ +import crypto.rand + +fn test_reading() ? { + a := rand.read(32) ? + // dump(a.hex()) + assert a.len == 32 + mut histogram := [256]int{} + for b in a { + histogram[b]++ + } + // dump(histogram) + for h in histogram { + assert h < 10 + } +} |