hash function script