2020-01-28 23:43:09 +01:00
|
|
|
import hash.fnv1a
|
|
|
|
|
|
|
|
fn test_fnv1a() {
|
2020-02-05 10:00:11 +01:00
|
|
|
$if windows {
|
|
|
|
return
|
|
|
|
}
|
2020-01-28 23:43:09 +01:00
|
|
|
a := 'apple'
|
|
|
|
b := fnv1a.sum64_string(a)
|
|
|
|
c := fnv1a.sum64(a.bytes())
|
2020-03-11 01:31:24 +01:00
|
|
|
assert b.hex() == 'f74a62a458befdbf'
|
|
|
|
assert c.hex() == 'f74a62a458befdbf'
|
2020-01-28 23:43:09 +01:00
|
|
|
}
|