Hashing functions, mostly from Bob Jenkins. More...
Hashing functions, mostly from Bob Jenkins.
Definition in file Hasher.C.
#include "src/OpenFOAM/primitives/hashes/Hasher/Hasher.H"#include "src/OpenFOAM/primitives/hashes/Hasher/HasherInt.H"
Include dependency graph for Hasher.C:Go to the source code of this file.
Defines | |
| #define | bitRotateLeft(x, nBits) (((x) << (nBits)) | ((x) >> (32 - (nBits)))) |
| #define | bitMixer(a, b, c) |
| #define | bitMixerFinal(a, b, c) |
Functions | |
| static unsigned | jenkins_hashlittle (const void *key, size_t length, unsigned initval) |
| specialized little-endian code
| |
| static unsigned | jenkins_hashbig (const void *key, size_t length, unsigned initval) |
| #define bitRotateLeft | ( | x, | |
| nBits | |||
| ) | (((x) << (nBits)) | ((x) >> (32 - (nBits)))) |
| #define bitMixer | ( | a, | |
| b, | |||
| c | |||
| ) |
{ \
a -= c; a ^= bitRotateLeft(c, 4); c += b; \
b -= a; b ^= bitRotateLeft(a, 6); a += c; \
c -= b; c ^= bitRotateLeft(b, 8); b += a; \
a -= c; a ^= bitRotateLeft(c,16); c += b; \
b -= a; b ^= bitRotateLeft(a,19); a += c; \
c -= b; c ^= bitRotateLeft(b, 4); b += a; \
}
Definition at line 116 of file Hasher.C.
Referenced by Foam::HasherDual(), Foam::HasherInt(), jenkins_hashbig(), and jenkins_hashlittle().
| #define bitMixerFinal | ( | a, | |
| b, | |||
| c | |||
| ) |
{ \
c ^= b; c -= bitRotateLeft(b, 14); \
a ^= c; a -= bitRotateLeft(c, 11); \
b ^= a; b -= bitRotateLeft(a, 25); \
c ^= b; c -= bitRotateLeft(b, 16); \
a ^= c; a -= bitRotateLeft(c, 4); \
b ^= a; b -= bitRotateLeft(a, 14); \
c ^= b; c -= bitRotateLeft(b, 24); \
}
Definition at line 151 of file Hasher.C.
Referenced by Foam::HasherDual(), Foam::HasherInt(), jenkins_hashbig(), and jenkins_hashlittle().
| static unsigned jenkins_hashlittle | ( | const void * | key, |
| size_t | length, | ||
| unsigned | initval | ||
| ) | [static]
|
specialized little-endian code
Definition at line 193 of file Hasher.C.
References b, bitMixer, bitMixerFinal, and k().
Referenced by Foam::Hasher().
| static unsigned jenkins_hashbig | ( | const void * | key, |
| size_t | length, | ||
| unsigned | initval | ||
| ) | [static]
|
Definition at line 371 of file Hasher.C.
References b, bitMixer, bitMixerFinal, and k().
Referenced by Foam::Hasher().