- MurMur3, SMHasher. , SMHasher. , , , .
Murmur3_x86_32
| Input | Seed | Expected |
|
| (no bytes) | 0 | 0 | with zero data and zero seed, everything becomes zero
| (no bytes) | 1 | 0x514E28B7 | ignores nearly all the math
| (no bytes) | 0xffffffff | 0x81F16F39 | make sure your seed uses unsigned 32-bit math
| FF FF FF FF | 0 | 0x76293B50 | make sure 4-byte chunks use unsigned math
| 21 43 65 87 | 0 | 0xF55B516B | Endian order. UInt32 should end up as 0x87654321
| 21 43 65 87 | 0x5082EDEE | 0x2362F9DE | Special seed value eliminates initial key with xor
| 21 43 65 | 0 | 0x7E4A8634 | Only three bytes. Should end up as 0x654321
| 21 43 | 0 | 0xA0F7B07A | Only two bytes. Should end up as 0x4321
| 21 | 0 | 0x72661CF4 | Only one byte. Should end up as 0x21
| 00 00 00 00 | 0 | 0x2362F9DE | Make sure compiler doesn't see zero and convert to null
| 00 00 00 | 0 | 0x85F0B427 |
| 00 00 | 0 | 0x30F4C306 |
| 00 | 0 | 0x514E28B7 |
, , , . :
:
TestString("", 0, 0);
TestString("", 1, 0x514E28B7);
TestString("", 0xffffffff, 0x81F16F39);
TestString("\0\0\0\0", 0, 0x2362F9DE);
TestString("aaaa", 0x9747b28c, 0x5A97808A);
TestString("aaa", 0x9747b28c, 0x283E0130);
TestString("aa", 0x9747b28c, 0x5D211726);
TestString("a", 0x9747b28c, 0x7FA09EA6);
TestString("abcd", 0x9747b28c, 0xF0478627);
TestString("abc", 0x9747b28c, 0xC84A62DD);
TestString("ab", 0x9747b28c, 0x74875592);
TestString("a", 0x9747b28c, 0x7FA09EA6);
TestString("Hello, world!", 0x9747b28c, 0x24884CBA);
TestString("ππππππππ", 0x9747b28c, 0xD58063C1);
TestString(StringOfChar("a", 256), 0x9747b28c, 0x37405BDC);
11 SHA-2, Murmur3.
TestString("abc", 0, 0xB3DD93FA);
TestString("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", 0, 0xEE925B90);
, , :
- :
"The quick brown fox jumps over the lazy dog" - : 0x9747b28c
- : 0x2FA826CD
- / .
, , , SMHasher 256 KeySetTest.cpp - VerificationTest(...).
Delphi. Lua ( ).
. , . .