Hacker News new | ask | show | jobs
by omegaworks 2599 days ago
Technically speaking, a hash is just a function that maps arbitrary data into a fixed size set of outputs.

f(x) = 1 is a hash function. A catastrophically bad one to use for something like a hashmap, but a hash function nonetheless.

1 comments

Although if you’re implementing a hashmap from scratch, that is a very good hash function to use temporarily while building collision management.