Live data from Hacker News

Hashing

samwho.dev

11–20 of 68 posts

Re: Hashing

#11

> The Avalance Effect > Another way hash functions get evaluated is on something called the "avalanche effect." This refers to how many bits in the output value change when just a single bit of the input changes. To say that a hash function has a good avalanche effect, a single bit flip in the input should result in an average of 50% the output bits flipping. I think it's important to note that this isn't a property…

So technically truncating and then padding is a hash function

[deleted]

Re: Hashing

#12
Between Sam and Bartosz, I think it's time to bite the bullet and get an RSS reader set up. Anyone got any good app recommendations for Android?

Re: Hashing

#14
cool, I enjoyed reading article and playing with visualizations. I liked it a lot.

How can I learn to design a hash function? It is possible to understand that stringSum is bad compared to murmur3 by evaluating it against test cases, but what properties make it bad. Is it summation compared to xoring in murmur3? I intuit that summation is kinda lossy, but ofc there is much more rigorous work put into it. It would be really cool to learn more about this. Thank you

Re: Hashing

#15
post #12

Between Sam and Bartosz, I think it's time to bite the bullet and get an RSS reader set up. Anyone got any good app recommendations for Android?

To be mentioned in the same breath as Bartosz Ciechanowski is an incredible compliment, thank you I will say up front: my posts don't read well in an RSS reader. Sorry about that. But at least you'll get a notification when new ones come out.

Re: Hashing

#16

cool, I enjoyed reading article and playing with visualizations. I liked it a lot. How can I learn to design a hash function? It is possible to understand that stringSum is bad compared to murmur3 by evaluating it against test cases, but what properties make it bad. Is it summation compared to xoring in murmur3? I intuit that summation is kinda lossy, but ofc there is much more rigorous work put into it. It would be…

I'm actually not sure, to be honest. The post explicitly doesn't touch on the implementation of murmur3, and part of the reason is that while I can see what it's doing, I have no idea why it's doing it.

The initial announcement of murmur (https://tanjent.livejournal.com/756623.html) makes it seem like it's trial and error.

Re: Hashing

#18

> The Avalance Effect > Another way hash functions get evaluated is on something called the "avalanche effect." This refers to how many bits in the output value change when just a single bit of the input changes. To say that a hash function has a good avalanche effect, a single bit flip in the input should result in an average of 50% the output bits flipping. I think it's important to note that this isn't a property…

So technically truncating and then padding is a hash function

Division by size is also very popular. 1:1 mapping ditto

Re: Hashing

#19

> The Avalance Effect > Another way hash functions get evaluated is on something called the "avalanche effect." This refers to how many bits in the output value change when just a single bit of the input changes. To say that a hash function has a good avalanche effect, a single bit flip in the input should result in an average of 50% the output bits flipping. I think it's important to note that this isn't a property…

> You can use LSHs […] to help with nearest neighbor searches.

Yes! A good example of this in graphics is a spatial nearest neighbor search. Space filling curves like the Morton and Hilbert curves are often used as hash functions that can preserve some amount of locality for 2-D / 3-D / N-D points. A locally sensitive hash function can basically be used to provide a sort key for data that doesn’t otherwise have a key, while increasing the odds that any two keys that are similar point to data that are also similar. This is useful on GPUs in order to improve coherence/performance of threads operating on spatial points.

https://en.wikipedia.org/wiki/Z-order_curve

https://en.wikipedia.org/wiki/Hilbert_curve

Re: Hashing

#20

cool, I enjoyed reading article and playing with visualizations. I liked it a lot. How can I learn to design a hash function? It is possible to understand that stringSum is bad compared to murmur3 by evaluating it against test cases, but what properties make it bad. Is it summation compared to xoring in murmur3? I intuit that summation is kinda lossy, but ofc there is much more rigorous work put into it. It would be…

The famous Bob Jenkins has lots of info on hash function design:

http://www.burtleburtle.net/bob/index.html

http://www.burtleburtle.net/bob/hash/index.html

Post reply on HN