aboutsummaryrefslogtreecommitdiff
path: root/v_windows/v/old/vlib/crypto/rand/crypto_rand_read_test.v
blob: 824923d96c784f6153650c4442176c1276c1ce7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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
	}
}