Turn hashing into a library and share code.