converted hash function