Move hash function to a separate file.