Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hash: MurmurHash3 & CityHash functions #10245

Closed
baijum opened this issue Mar 25, 2015 · 5 comments
Closed

hash: MurmurHash3 & CityHash functions #10245

baijum opened this issue Mar 25, 2015 · 5 comments

Comments

@baijum
Copy link

baijum commented Mar 25, 2015

MurmurHash3 & CityHash are non-cryptographic hash functions suitable for general hash-based lookup. These hash functions would be a good addition to the standard library.

May be Spooky also can be considered:
http://burtleburtle.net/bob/hash/spooky.html

More info:
http://en.wikipedia.org/wiki/MurmurHash
http://en.wikipedia.org/wiki/CityHash

http://google-opensource.blogspot.in/2011/04/introducing-cityhash.html
https://programmers.stackexchange.com/questions/49550/which-hashing-algorithm-is-best-for-uniqueness-and-speed
https://stackoverflow.com/questions/11899616/murmurhash-what-is-it/11901654#11901654
http://research.neustar.biz/2012/02/02/choosing-a-good-hash-function-part-3/

@baijum
Copy link
Author

baijum commented Mar 25, 2015

Looks like there are few more:

@bradfitz
Copy link
Contributor

Unless one of these is required by TLS, it is our intention to not expand the standard library unnecessarily. These can be fetched using "go get" and several of these already are.

@baijum
Copy link
Author

baijum commented Mar 25, 2015

@bradfitz These hash functions are "non-cryptographic" so it won't be useful for TLS. In fact, there are 4 packages in Go standard library not used by any cryptographic package.

See the bottom of this page:
http://golang.org/pkg/hash/

FWIW, Rust standard library has only one (compared to 4 in Go), that is siphash:
http://doc.rust-lang.org/1.0.0-alpha.2/std/hash/struct.SipHasher.html
https://github.com/rust-lang/rust/blob/master/src/libcore/hash/sip.rs

@baijum
Copy link
Author

baijum commented Mar 25, 2015

Python also adopts Siphash, this PEP (final) has a good comparison with others:
https://www.python.org/dev/peps/pep-0456/

@bradfitz
Copy link
Contributor

I know what these are. What other languages include in their standard libraries has no bearing here. My previous statement stands. You can use "go get". See:

http://godoc.org/?q=murmur
http://godoc.org/?q=cityhash
http://godoc.org/?q=farmhash
http://godoc.org/?q=siphash
etc.

@mikioh mikioh changed the title MurmurHash3 & CityHash non-cryptographic hash functions hash: MurmurHash3 & CityHash functions Mar 25, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants