mirror of
https://github.com/isar/libmdbx.git
synced 2025-08-23 09:04:26 +08:00
mdbx-test: re-seed keygen over iterations.
Change-Id: I2cfd635fc46c808dd8431217b75a30780e0c3958
This commit is contained in:
21
test/utils.h
21
test/utils.h
@@ -327,12 +327,25 @@ std::string format(const char *fmt, ...);
|
||||
|
||||
uint64_t entropy_ticks(void);
|
||||
uint64_t entropy_white(void);
|
||||
static inline uint64_t bleach64(uint64_t dirty) {
|
||||
return mul_64x64_high(bswap64(dirty), UINT64_C(17048867929148541611));
|
||||
static inline uint64_t bleach64(uint64_t v) {
|
||||
// Tommy Ettinger, https://www.blogger.com/profile/04953541827437796598
|
||||
// http://mostlymangling.blogspot.com/2019/01/better-stronger-mixer-and-test-procedure.html
|
||||
v ^= rot64(v, 25) ^ rot64(v, 50);
|
||||
v *= UINT64_C(0xA24BAED4963EE407);
|
||||
v ^= rot64(v, 24) ^ rot64(v, 49);
|
||||
v *= UINT64_C(0x9FB21C651E98DF25);
|
||||
return v ^ v >> 28;
|
||||
}
|
||||
|
||||
static inline uint32_t bleach32(uint32_t dirty) {
|
||||
return (uint32_t)((bswap32(dirty) * UINT64_C(2175734609)) >> 32);
|
||||
static inline uint32_t bleach32(uint32_t x) {
|
||||
// https://github.com/skeeto/hash-prospector
|
||||
// exact bias: 0.17353355999581582
|
||||
x ^= x >> 16;
|
||||
x *= UINT32_C(0x7feb352d);
|
||||
x ^= 0x3027C563 ^ (x >> 15);
|
||||
x *= UINT32_C(0x846ca68b);
|
||||
x ^= x >> 16;
|
||||
return x;
|
||||
}
|
||||
|
||||
static inline uint64_t prng64_map1_careless(uint64_t state) {
|
||||
|
Reference in New Issue
Block a user