Avalor Interview Question

How does a hash function works