ATLAS Offline Software
Loading...
Searching...
No Matches
HLTUtils Namespace Reference

Functions

 string2hash (string)

Function Documentation

◆ string2hash()

HLTUtils.string2hash ( string)
Hashes a string using the HLT's HLTUtils::string2hash hashing function. Python implementation. 

Definition at line 5 of file HLTUtils.py.

5def string2hash(string):
6 """Hashes a string using the HLT's HLTUtils::string2hash hashing function. Python implementation. """
7 hash = 0xd2d84a61
8 mask = 0xffffffff
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
13 return hash