Hashes a string using the HLT's HLTUtils::string2hash hashing function. Python implementation.
Definition at line 5 of file HLTUtils.py.
6 """Hashes a string using the HLT's HLTUtils::string2hash hashing function. Python implementation. """
9 for character
in reversed(string):
10 hash ^= (( (((hash >> 5) & mask) + ord(character)) & mask) + ((hash << 7) & mask)) & mask
11 for character
in string:
12 hash ^= (( (((hash >> 5) & mask) + ord(character)) & mask) + ((hash << 7) & mask)) & mask