ATLAS Offline Software
Loading...
Searching...
No Matches
hash_functions.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef HASH_FUNCTIONS_H
6#define HASH_FUNCTIONS_H
7
8#include <functional>
9#include <string>
10
11namespace SG {
16 inline int simpleStringHash(const std::string& str, int maxInt=0xFFFF) {
17 int h(0), a(127);
18 for (std::string::size_type iC=0; iC<str.size(); iC++)
19 h = (a*h + str[iC]) % maxInt;
20 return h;
21 }
22
23}
24
25#endif
26
27
28
static Double_t a
Header file for AthHistogramAlgorithm.
Forward declaration.
int simpleStringHash(const std::string &str, int maxInt=0xFFFF)
simple hash function derived from Sedgewick Algorithms in C++ 3rd ed