3 ms·
Also curious about this. I'm writing something with a DAG storage scheme similar to git, currently using SHA-256 to hash blobs. Been thinking about switching to
by pshc 14y ago
Also curious about this. I'm writing something with a DAG storage scheme similar to git, currently using SHA-256 to hash blobs. Been thinking about switching to SHA-512, but there's no rush as I can easily switch hash functions anytime before initial public release. How much time/what indicators can I look for before considering a switch to SHA-3?
- raverbashing 14y agoFor regular hashing it makes no difference For cryptographic hashing it may make a difference, depending on the context.
- tripzilch 14y agoIn fact, for regular hashing you're probably better off using a non-cryptographic hash in the first place, because they're much faster. Instead of security, they're designed for avalanche behaviour and uniformity of the hash space. Cryptographic hashes also cover these design constraints (otherwise they'd be vulnerable), but a hash does not need to be cryptographic strength to be a really good algo to generate hash keys from blobs. Murmurhash and Cityhash are two excellent and fast non-crypto hashes. The FNV hash is also quite good, very fast, maybe not as good as Murmer and City, but has the advantage that if you like running your own, it's super-easy to implement (like two lines of C code easy). FNV hash http://www.isthe.com/chongo/tech/comp/fnv/index.html http://www.isthe.com/chongo/tech/comp/fnv/index.html Murmur hash http://en.wikipedia.org/wiki/MurmurHash http://en.wikipedia.org/wiki/MurmurHash City hash http://en.wikipedia.org/wiki/CityHash http://en.wikipedia.org/wiki/CityHash In case you're interested, here's two great explanations of what to look for in general purpose hashes (avalanche behaviour and uniformity): http://bretm.home.comcast.net/~bretm/hash/ http://bretm.home.comcast.net/~bretm/hash/ and http://www.partow.net/programming/hashfunctions/index.html http://www.partow.net/programming/hashfunctions/index.html
- dchest 14y agoFor git-like storage schemes speed is important. Keccak is slower than SHA-512, so you probably wouldn't want to switch to it.