summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortanjent@gmail.com <tanjent@gmail.com@77a7d1d3-4c08-bdc2-d393-d5859734b01a>2011-04-11 20:45:44 +0000
committertanjent@gmail.com <tanjent@gmail.com@77a7d1d3-4c08-bdc2-d393-d5859734b01a>2011-04-11 20:45:44 +0000
commit833fd8d1baf463eeeeff29a86fa29a67588453f0 (patch)
tree0f7d1994ea359fb73dce2e3ae79e11dc1bfc1fee
parentc2b49e0d2168979b648edcc449a36292449dd5f5 (diff)
downloadsrc-833fd8d1baf463eeeeff29a86fa29a67588453f0.tar.gz
Make verification failure print the hash names
Fix typo in murmur3f (rotl values didn't match) git-svn-id: http://smhasher.googlecode.com/svn/trunk@131 77a7d1d3-4c08-bdc2-d393-d5859734b01a
-rw-r--r--MurmurHash3.cpp2
-rw-r--r--main.cpp5
2 files changed, 4 insertions, 3 deletions
diff --git a/MurmurHash3.cpp b/MurmurHash3.cpp
index 8ce4688..97883fa 100644
--- a/MurmurHash3.cpp
+++ b/MurmurHash3.cpp
@@ -310,7 +310,7 @@ void MurmurHash3_x64_128 ( const void * key, const int len,
case 3: k1 ^= uint64_t(tail[ 2]) << 16;
case 2: k1 ^= uint64_t(tail[ 1]) << 8;
case 1: k1 ^= uint64_t(tail[ 0]) << 0;
- k1 *= c1; k1 = ROTL64(k1,29); k1 *= c2; h1 ^= k1;
+ k1 *= c1; k1 = ROTL64(k1,31); k1 *= c2; h1 ^= k1;
};
//----------
diff --git a/main.cpp b/main.cpp
index eaab22f..973ffa6 100644
--- a/main.cpp
+++ b/main.cpp
@@ -68,7 +68,7 @@ HashInfo g_hashes[] =
{ MurmurHash3_x86_32, 32, 0x3252D141, "Murmur3A", "MurmurHash3 for x86, 32-bit" },
{ MurmurHash3_x86_128, 128, 0xB3ECE62A, "Murmur3C", "MurmurHash3 for x86, 128-bit" },
- { MurmurHash3_x64_128, 128, 0x833607F9, "Murmur3F", "MurmurHash3 for x64, 128-bit" },
+ { MurmurHash3_x64_128, 128, 0x6384BA69, "Murmur3F", "MurmurHash3 for x64, 128-bit" },
};
@@ -103,7 +103,8 @@ void SelfTest ( void )
for(int i = 0; i < sizeof(g_hashes) / sizeof(HashInfo); i++)
{
HashInfo * info = & g_hashes[i];
-
+
+ printf("%16s - ",info->name);
pass &= VerificationTest(info->hash,info->hashbits,info->verification,true);
}