Home | History | Annotate | Download | only in ADT

Lines Matching full:seed

128 /// \brief Override the execution seed with a fixed value.
130 /// This hashing library uses a per-execution seed designed to change on each
137 /// which will forcibly set the seed to a fixed value. This must be done at the
196 inline uint64_t hash_1to3_bytes(const char *s, size_t len, uint64_t seed) {
202 return shift_mix(y * k2 ^ z * k3 ^ seed) * k2;
205 inline uint64_t hash_4to8_bytes(const char *s, size_t len, uint64_t seed) {
207 return hash_16_bytes(len + (a << 3), seed ^ fetch32(s + len - 4));
210 inline uint64_t hash_9to16_bytes(const char *s, size_t len, uint64_t seed) {
213 return hash_16_bytes(seed ^ a, rotate(b + len, len)) ^ b;
216 inline uint64_t hash_17to32_bytes(const char *s, size_t len, uint64_t seed) {
221 return hash_16_bytes(rotate(a - b, 43) + rotate(c ^ seed, 30) + d,
222 a + rotate(b ^ k3, 20) - c + len + seed);
225 inline uint64_t hash_33to64_bytes(const char *s, size_t len, uint64_t seed) {
245 return shift_mix((seed ^ (r * k0)) + vs) * k2;
248 inline uint64_t hash_short(const char *s, size_t length, uint64_t seed) {
250 return hash_4to8_bytes(s, length, seed);
252 return hash_9to16_bytes(s, length, seed);
254 return hash_17to32_bytes(s, length, seed);
256 return hash_33to64_bytes(s, length, seed);
258 return hash_1to3_bytes(s, length, seed);
260 return k2 ^ seed;
270 /// seed and the first 64-byte chunk.
272 static hash_state create(const char *s, uint64_t seed) {
274 0, seed, hash_16_bytes(seed, k1), rotate(seed ^ k1, 49),
275 seed * k1, shift_mix(seed), 0 };
320 /// \brief A global, fixed seed-override variable.
328 // FIXME: This needs to be a per-execution seed. This is just a placeholder
329 // implementation. Switching to a per-execution seed is likely to flush out
332 // However, if there is a fixed seed override set the first time this is
333 // called, return that instead of the per-execution seed.
335 static size_t seed = fixed_seed_override ? fixed_seed_override
337 return seed;
411 const size_t seed = get_execution_seed();
418 return hash_short(buffer, buffer_ptr - buffer, seed);
421 hash_state state = state.create(buffer, seed);
455 const size_t seed = get_execution_seed();
460 return hash_short(s_begin, length, seed);
463 hash_state state = state.create(s_begin, seed);
505 const size_t seed;
511 /// the seed and buffer setup.
513 : seed(get_execution_seed()) {}
536 state = state.create(buffer, seed);
627 return hash_short(buffer, buffer_ptr - buffer, seed);
723 // Similar to hash_4to8_bytes but using a seed instead of length.
724 const uint64_t seed = get_execution_seed();
727 return hash_16_bytes(seed + (a << 3), fetch32(s + 4));