Avalor interview question

How does a hash function works