ATLAS Offline Software
Loading...
Searching...
No Matches
HLTUtils.py
Go to the documentation of this file.
2# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3#
4
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
string2hash(string)
Definition HLTUtils.py:5