Code Monkey home page Code Monkey logo

Comments (5)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 22, 2024
With my implementation, when i hash "The quick brown fox jumps over the lazy 
dog" (using seed 0x9747b28c), i get:

0x2FA826CD

You post what *you* get, and if they match then we'll say it's ready to ship.

Original comment by [email protected] on 28 Apr 2012 at 12:20

from smhasher.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 22, 2024
SMHasher uses the VerificationTest function to check if a hash function is 
correctly implemented - it doesn't rely on correct capitalization or 
punctuation of "The quick brown fox..." and catches more implementation errors 
than a single test vector can. I'll make a note on the front page to point it 
out.

Original comment by [email protected] on 11 May 2012 at 5:44

  • Changed state: WontFix

from smhasher.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 22, 2024
While SMHasher certainly provides a more complete test suite, it's not very 
helpful in testing the implementation in another language. I have recently 
ported the hash to c# and generated a few test vectors for 3 different seeds 
(0x9747b28c, 0x0, 0xc58f1a7b) including a small collision test against english 
words.

x86_32:  http://pastebin.com/kkggV9Vx
x64_128: http://pastebin.com/k2VDbWkF

Original comment by [email protected] on 26 May 2012 at 8:43

from smhasher.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 22, 2024
So what is the correct x64_128 hash for "The quick brown fox jumps over the 
lazy dog" and zero seed?
Previous post = 6C1B07BC7BBC4BE347939AC4A93C437A

Python smhasher:
>>> hex(smhasher.murmur3_x64_128(u"The quick brown fox jumps over the lazy 
dog",0))
'0x6c1b07bc7bbc4be347939ac4a93c437aL'

Java Guava:
>>> System.out.println(Hashing.murmur3_128(0).hashString("The quick brown fox 
jumps over the lazy dog"));
4cae51b5316602c01c7c5642843e5fe7

Which version is correct?

Original comment by [email protected] on 13 Sep 2012 at 11:20

from smhasher.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 22, 2024
As I mentioned on the Guava bug 
(http://code.google.com/p/guava-libraries/issues/detail?id=1147),

In Guava, if you just call Hasher#hashString(String), it'll hash each character 
in order (no char encoding).

What you want is Hasher#hashString(String, Charset):

HashCode foxHash =  Hashing.murmur3_128(0).hashString(
    "The quick brown fox jumps over the lazy dog", Charsets.UTF_8);
assertEquals("6c1b07bc7bbc4be347939ac4a93c437a", foxHash.toString());
// This is the same as your Python output.

Original comment by kurt.kluever on 13 Sep 2012 at 4:51

from smhasher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.