3 ms·
Specifically, these functions to not provide "uniform distribution".
by gabetax 3y ago
Specifically, these functions to not provide "uniform distribution".
- jagged-chisel 3y agoThat isn’t a requirement of an algorithm called a hash function
- gabetax 3y agoFrom the article: > For a function to be useful as a hash function, it must exhibit the property of uniform distribution It's also listed as the first property on the Wikipedia page: https://en.wikipedia.org/wiki/Hash_function#Uniformity https://en.wikipedia.org/wiki/Hash_function#Uniformity
- jagged-chisel 3y agoI can’t find the text you quoted. The article starts off: > A hash function is any function that can be used to map data of arbitrary size to fixed-size values And the first sentence in the section you link says > A good hash function should map the expected inputs as evenly as possible over its output range. It doesn’t have to be “good” to be a hash function.
- anamexis 3y agoThat's not a meaningful definition of a hash function, then. def hash(val): return 0
- jagged-chisel 3y agoYes, this is a hash function. Whether it’s “useful” or “good” is the purview of the architect. Tangential edit: https://xkcd.com/221/ https://xkcd.com/221/
- pcthrowaway 3y agoThe best thing about that one is that it seeds the panel with a random number every time you refresh
- throwmeaway1212 3y agoThat has a pretty uniform distribution..