siprng_test.go (view raw)
1package captcha
2
3import "testing"
4
5func TestSiphash(t *testing.T) {
6 good := uint64(0xe849e8bb6ffe2567)
7 cur := siphash(0, 0, 0)
8 if cur != good {
9 t.Fatalf("siphash: expected %x, got %x", good, cur)
10 }
11}
12
13func BenchmarkSiprng(b *testing.B) {
14 b.SetBytes(8)
15 p := &siprng{};
16 for i := 0; i < b.N; i++ {
17 p.Uint64()
18 }
19}