some frequently used hashing code
fixed test