rpm
5.2.1
|
Go to the source code of this file.
Data Structures | |
union | _dbswap |
Defines | |
#define | HASH_LITTLE_ENDIAN (endian.uc[0] == (unsigned char) 0x44) |
#define | HASH_BIG_ENDIAN (endian.uc[0] == (unsigned char) 0x11) |
#define | ROTL32(x, s) (((x) << (s)) | ((x) >> (32 - (s)))) |
#define | _JLU3_INIT(_h, _size) (0xdeadbeef + ((rpmuint32_t)(_size)) + (_h)) |
#define | _JLU3_MIX(a, b, c) |
#define | _JLU3_FINAL(a, b, c) |
_JLU3_FINAL -- final mixing of 3 32-bit values (a,b,c) into c | |
Variables | |
static union _dbswap | endian |
#define _JLU3_FINAL | ( | a, | |
b, | |||
c | |||
) |
{ \ c ^= b; c -= ROTL32(b,14); \ a ^= c; a -= ROTL32(c,11); \ b ^= a; b -= ROTL32(a,25); \ c ^= b; c -= ROTL32(b,16); \ a ^= c; a -= ROTL32(c,4); \ b ^= a; b -= ROTL32(a,14); \ c ^= b; c -= ROTL32(b,24); \ }
_JLU3_FINAL -- final mixing of 3 32-bit values (a,b,c) into c
Pairs of (a,b,c) values differing in only a few bits will usually produce values of c that look totally different. This was tested for * pairs that differed by one bit, by two bits, in any combination of top bits of (a,b,c), or in any combination of bottom bits of (a,b,c). * "differ" is defined as +, -, ^, or ~^. For + and -, I transformed the output delta to a Gray code (a^(a>>1)) so a string of 1's (as is commonly produced by subtraction) look like a single 1-bit difference. * the base values were pseudorandom, all zero but one bit set, or all zero plus a counter that starts at zero.
These constants passed: 14 11 25 16 4 14 24 12 14 25 16 4 14 24 and these came close: 4 8 15 26 3 22 24 10 8 15 26 3 22 24 11 8 15 26 3 22 24
#define _JLU3_INIT | ( | _h, | |
_size | |||
) | (0xdeadbeef + ((rpmuint32_t)(_size)) + (_h)) |
#define _JLU3_MIX | ( | a, | |
b, | |||
c | |||
) |
#define HASH_BIG_ENDIAN (endian.uc[0] == (unsigned char) 0x11) |
#define HASH_LITTLE_ENDIAN (endian.uc[0] == (unsigned char) 0x44) |
#define ROTL32 | ( | x, | |
s | |||
) | (((x) << (s)) | ((x) >> (32 - (s)))) |