Wrote String hashing function