MCPcopy Create free account
hub / github.com/CovenantSQL/CovenantSQL / TestFNVHash32B

Function TestFNVHash32B

crypto/hash/hashfuncs_test.go:153–172  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

151}
152
153func TestFNVHash32B(t *testing.T) {
154 tests := []struct {
155 out []byte
156 in string
157 }{
158 {[]byte{0x81, 0x1c, 0x9d, 0xc5}, ""},
159 {[]byte{0x05, 0x0c, 0x5d, 0x7e}, "a"},
160 {[]byte{0x70, 0x77, 0x2d, 0x38}, "ab"},
161 {[]byte{0x43, 0x9c, 0x2f, 0x4b}, "abc"},
162 }
163
164 for _, test := range tests {
165 hash := FNVHash32B([]byte(test.in))
166 if bytes.Compare(hash, test.out) != 0 {
167 t.Errorf("FNVHash32B(%q) = %s, want %s", test.in, hash,
168 test.out)
169 continue
170 }
171 }
172}
173
174func TestFNVHash32uint(t *testing.T) {
175 tests := []struct {

Callers

nothing calls this directly

Calls 2

FNVHash32BFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected