C: Hashes a string and sorts key into buckets