forked from karanlyons/murmurHash3.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.html
77 lines (73 loc) · 4.21 KB
/
tests.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!doctype html>
<html lang="en">
<head>
<title>MurmurHash3.js Test Suite</title>
<script>
'use strict';
var murmurHash3 = "Some Old Value";
</script>
<script type="text/javascript" src="./murmurHash3.min.js"></script>
</head>
<body>
Test(s) Failed.
</body>
<script>
'use strict';
var noConflict;
if (
// x86 32bit Tests
(murmurHash3.x86.hash32("I will not buy this record, it is scratched.") === 2832214938) &&
(murmurHash3.x86.hash32("") === 0) &&
(murmurHash3.x86.hash32("0") === 3530670207) &&
(murmurHash3.x86.hash32("01") === 1642882560) &&
(murmurHash3.x86.hash32("012") === 3966566284) &&
(murmurHash3.x86.hash32("0123") === 3558446240) &&
(murmurHash3.x86.hash32("01234") === 433070448) &&
(murmurHash3.x86.hash32("", 1) === 1364076727) &&
// x86 128bit Tests
(murmurHash3.x86.hash128("I will not buy this tobacconist's, it is scratched.") === "ef3f78669b5b7ba200f3f98e889adeaf") &&
(murmurHash3.x86.hash128("") === "00000000000000000000000000000000") &&
(murmurHash3.x86.hash128("0") === "a5eb34f80ab2409ea5eb34f8a5eb34f8") &&
(murmurHash3.x86.hash128("01") === "674f3b210f87acb4674f3b21674f3b21") &&
(murmurHash3.x86.hash128("012") === "4c13d78ecd94fea54c13d78e4c13d78e") &&
(murmurHash3.x86.hash128("0123") === "485d3536dc378fea485d3536485d3536") &&
(murmurHash3.x86.hash128("01234") === "7b3b211635c5b3ee00ae108800ae1088") &&
(murmurHash3.x86.hash128("012345") === "6ce1944bdb26dc75f825536af825536a") &&
(murmurHash3.x86.hash128("0123456") === "86d15c02b708d0a1495d053b495d053b") &&
(murmurHash3.x86.hash128("01234567") === "92160402aa22bf8463b83c5e63b83c5e") &&
(murmurHash3.x86.hash128("012345678") === "75d48126571b5f674ca675dcd0205c30") &&
(murmurHash3.x86.hash128("0123456789") === "2e528b330017a61e57a11235a5443f20") &&
(murmurHash3.x86.hash128("0123456789a") === "921f15e438a2ed0fa971884f2caa7f97") &&
(murmurHash3.x86.hash128("0123456789ab") === "b6982a7ecfaa93f904d3d08f53412b5d") &&
(murmurHash3.x86.hash128("0123456789abc") === "cc6d9d01c970af1dfc11eee3dd00c683") &&
(murmurHash3.x86.hash128("0123456789abcd") === "c0a5114d6f34d20a63f51794ae0d83c5") &&
(murmurHash3.x86.hash128("0123456789abcde") === "4d0818c03c76c46da78673faadd433da") &&
(murmurHash3.x86.hash128("0123456789abcdef") === "36aed30afb7d4409572b3bfd48ad1d9b") &&
(murmurHash3.x86.hash128("", 1) === "54d201b988c4adec54d201b954d201b9") &&
// x64 128bit Tests
(murmurHash3.x64.hash128("I will not buy this tobacconist's, it is scratched.") === "d30654abbd8227e367d73523f0079673") &&
(murmurHash3.x64.hash128("") === "00000000000000000000000000000000") &&
(murmurHash3.x64.hash128("0") === "2ac9debed546a3803a8de9e53c875e09") &&
(murmurHash3.x64.hash128("01") === "649e4eaa7fc1708ee6945110230f2ad6") &&
(murmurHash3.x64.hash128("012") === "ce68f60d7c353bdb00364cd5936bf18a") &&
(murmurHash3.x64.hash128("0123") === "0f95757ce7f38254b4c67c9e6f12ab4b") &&
(murmurHash3.x64.hash128("01234") === "0f04e459497f3fc1eccc6223a28dd613") &&
(murmurHash3.x64.hash128("012345") === "88c0a92586be0a2781062d6137728244") &&
(murmurHash3.x64.hash128("0123456") === "13eb9fb82606f7a6b4ebef492fdef34e") &&
(murmurHash3.x64.hash128("01234567") === "8236039b7387354dc3369387d8964920") &&
(murmurHash3.x64.hash128("012345678") === "4c1e87519fe738ba72a17af899d597f1") &&
(murmurHash3.x64.hash128("0123456789") === "3f9652ac3effeb248027a17cf2990b07") &&
(murmurHash3.x64.hash128("0123456789a") === "4bc3eacd29d386297cb2d9e797da9c92") &&
(murmurHash3.x64.hash128("0123456789ab") === "66352b8cee9e3ca7a9edf0b381a8fc58") &&
(murmurHash3.x64.hash128("0123456789abc") === "5eb2f8db4265931e801ce853e61d0ab7") &&
(murmurHash3.x64.hash128("0123456789abcd") === "07a4a014dd59f71aaaf437854cd22231") &&
(murmurHash3.x64.hash128("0123456789abcde") === "a62dd5f6c0bf23514fccf50c7c544cf0") &&
(murmurHash3.x64.hash128("0123456789abcdef") === "4be06d94cf4ad1a787c35b5c63a708da") &&
(murmurHash3.x64.hash128("", 1) === "4610abe56eff5cb551622daa78f83583") &&
// noConflict Test
(noConflict = murmurHash3.noConflict()) &&
(murmurHash3 === "Some Old Value") &&
(noConflict.version === "2.1.1")
) { document.body.innerHTML = "All Tests Passed."; }
</script>
</html>