Adding hashing function from old project.