* hash_bytes_uint32() -- hash a 32-bit value to a 32-bit value * * This has the same result as * hash_bytes(&k, sizeof(uint32)) * but is faster and doesn't force the caller to store k into memory. */
| 624 | * but is faster and doesn't force the caller to store k into memory. |
| 625 | */ |
| 626 | uint32 |
| 627 | hash_bytes_uint32(uint32 k) |
| 628 | { |
| 629 | uint32 a, |
| 630 | b, |
| 631 | c; |
| 632 | |
| 633 | a = b = c = 0x9e3779b9 + (uint32) sizeof(uint32) + 3923095; |
| 634 | a += k; |
| 635 | |
| 636 | final(a, b, c); |
| 637 | |
| 638 | /* report the result */ |
| 639 | return c; |
| 640 | } |
| 641 | |
| 642 | /* |
| 643 | * hash_bytes_uint32_extended() -- hash 32-bit value to 64-bit value, with seed |
no test coverage detected