|
The Gaudi Framework master (9cc87df9)
|
Create a hash with a large avalanche effect from 32 or 64 bit integers or a string. More...
Functions | |
| std::uint32_t | mix (std::uint32_t state) |
| Create a hash with a large avalanche effect from a 32 bit integer. | |
| std::uint32_t | mix32 (std::uint32_t state, std::uint32_t extra) |
| mix some 'extra' entropy into 'state' and return result | |
| std::uint32_t | mix64 (std::uint32_t state, uint64_t extra) |
| mix some 'extra' entropy into 'state' and return result | |
| std::uint32_t | mixString (std::uint32_t state, const std::string &extra) |
| mix some 'extra' entropy into 'state' and return result | |
Create a hash with a large avalanche effect from 32 or 64 bit integers or a string.
note: the constants below are not arbitrary, but are picked carefully such that the bit shuffling has a large 'avalanche' effect... Code by Brett Mulvey (old link: http://bretm.home.comcast.net/~bretm/hash/)
note: as a result, you might call this a quasi-random (not to be confused with psuedo-random!) number generator, in that it generates an output which satisfies a requirement on the uniformity of its output distribution. (and not on the predictability of the next number in the sequence, based on knowledge of the preceding numbers)
note: another way to look at this is is as an (approximation of an) evaporating black hole: whatever you dump in to it, you get something uniformly distributed back ;-)
| std::uint32_t Gaudi::Utils::QuasiRandom::mix | ( | std::uint32_t | state | ) |
Create a hash with a large avalanche effect from a 32 bit integer.
Definition at line 18 of file QuasiRandom.cpp.
| std::uint32_t Gaudi::Utils::QuasiRandom::mix32 | ( | std::uint32_t | state, |
| std::uint32_t | extra ) |
mix some 'extra' entropy into 'state' and return result
Definition at line 30 of file QuasiRandom.cpp.
| std::uint32_t Gaudi::Utils::QuasiRandom::mix64 | ( | std::uint32_t | state, |
| uint64_t | extra ) |
mix some 'extra' entropy into 'state' and return result
Definition at line 32 of file QuasiRandom.cpp.
| std::uint32_t Gaudi::Utils::QuasiRandom::mixString | ( | std::uint32_t | state, |
| const std::string & | extra ) |
mix some 'extra' entropy into 'state' and return result
Definition at line 37 of file QuasiRandom.cpp.