mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 22:04:21 +00:00
Update xxhash test
This commit is contained in:
parent
66a5bb7d72
commit
962824335b
1 changed files with 14 additions and 14 deletions
|
|
@ -246,23 +246,23 @@ pub const XxHash32 = struct {
|
|||
test "xxhash64" {
|
||||
const hash = XxHash64.hash;
|
||||
|
||||
try expectEqual(hash(""), 0xef46db3751d8e999);
|
||||
try expectEqual(hash("a"), 0xd24ec4f1a98c6e5b);
|
||||
try expectEqual(hash("abc"), 0x44bc2cf5ad770999);
|
||||
try expectEqual(hash("message digest"), 0x066ed728fceeb3be);
|
||||
try expectEqual(hash("abcdefghijklmnopqrstuvwxyz"), 0xcfe1f278fa89835c);
|
||||
try expectEqual(hash("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"), 0xaaa46907d3047814);
|
||||
try expectEqual(hash("12345678901234567890123456789012345678901234567890123456789012345678901234567890"), 0xe04a477f19ee145d);
|
||||
try expectEqual(hash(0, ""), 0xef46db3751d8e999);
|
||||
try expectEqual(hash(0, "a"), 0xd24ec4f1a98c6e5b);
|
||||
try expectEqual(hash(0, "abc"), 0x44bc2cf5ad770999);
|
||||
try expectEqual(hash(0, "message digest"), 0x066ed728fceeb3be);
|
||||
try expectEqual(hash(0, "abcdefghijklmnopqrstuvwxyz"), 0xcfe1f278fa89835c);
|
||||
try expectEqual(hash(0, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"), 0xaaa46907d3047814);
|
||||
try expectEqual(hash(0, "12345678901234567890123456789012345678901234567890123456789012345678901234567890"), 0xe04a477f19ee145d);
|
||||
}
|
||||
|
||||
test "xxhash32" {
|
||||
const hash = XxHash32.hash;
|
||||
|
||||
try expectEqual(hash(""), 0x02cc5d05);
|
||||
try expectEqual(hash("a"), 0x550d7456);
|
||||
try expectEqual(hash("abc"), 0x32d153ff);
|
||||
try expectEqual(hash("message digest"), 0x7c948494);
|
||||
try expectEqual(hash("abcdefghijklmnopqrstuvwxyz"), 0x63a14d5f);
|
||||
try expectEqual(hash("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"), 0x9c285e64);
|
||||
try expectEqual(hash("12345678901234567890123456789012345678901234567890123456789012345678901234567890"), 0x9c05f475);
|
||||
try expectEqual(hash(0, ""), 0x02cc5d05);
|
||||
try expectEqual(hash(0, "a"), 0x550d7456);
|
||||
try expectEqual(hash(0, "abc"), 0x32d153ff);
|
||||
try expectEqual(hash(0, "message digest"), 0x7c948494);
|
||||
try expectEqual(hash(0, "abcdefghijklmnopqrstuvwxyz"), 0x63a14d5f);
|
||||
try expectEqual(hash(0, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"), 0x9c285e64);
|
||||
try expectEqual(hash(0, "12345678901234567890123456789012345678901234567890123456789012345678901234567890"), 0x9c05f475);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue