add hashing function and test