Live data from Hacker News

Show HN: Discohash – Fast Hash

github.com

1–10 of 44 posts

Re: Show HN: Discohash – Fast Hash

#3

Simple hash, 128-bit mixing function is just: mix(const int A) { const int B = A+1; ds[A] *= P; ds[A] = rot(ds[A], 23); ds[A] *= Q; ds[B] ^= ds[A]; ds[B] *= P; ds[B] = rot(ds[B], 23); ds[B] *= Q; } with P and Q prime.

Please modify this: "The standard digest is 64-bits, but you can modify it to take 128-bits if you want a cryptographically secure hash."

Just because it's 128-bit doesn't make it cryptographically secure.

Re: Show HN: Discohash – Fast Hash

#4
> The standard digest is 64-bits, but you can modify it to take 128-bits if you want a cryptographically secure hash.

There's not even an attempt at a preliminary cryptanalysis anywhere as far as I can tell. I'd advise staying far away from this for cryptography, especially if it considers a 128-bit digest size reasonable for anything but a message authentication code.

Re: Show HN: Discohash – Fast Hash

#7
This is a hash designed for non-cryptographic use, like in hash tables or bloom filters. You can tell by their small output size, which greatly reduces the cost of a brute-force collision search. It's also in the linked readme.

Hash function families with a similar target usecase include: cityhash, falkhash, farmhash, FNV, meowhash, metrohash, murmur, t1ha, wyhash, xxh.

The SMHasher suite tests hash functions for speed, distribution, bias, and collisions. This function ranks well in those tests.

Re: Show HN: Discohash – Fast Hash

#8
post #6

Should I use this as an everyday hash function (for non-security purposes)? I am always interested when these get attention, but I don't know enough about the implications to switch over from just using SHA.

Are you running into performance issues with SHA? If not, I wouldn't change

Re: Show HN: Discohash – Fast Hash

#9
post #7

This is a hash designed for non-cryptographic use, like in hash tables or bloom filters. You can tell by their small output size, which greatly reduces the cost of a brute-force collision search. It's also in the linked readme. Hash function families with a similar target usecase include: cityhash, falkhash, farmhash, FNV, meowhash, metrohash, murmur, t1ha, wyhash, xxh. The SMHasher suite tests hash functions for spe…

I am using Bob Jenkin's one_at_a_time hash for that purpose.

It is really simple and works with unaligned data.

But it is not doing well in benchmarks. I wonder if I should use another one

Post reply on HN