Non-cryptographic hash.
More...
|
| uint32_t | hash (const uint8_t *bytes, const uint32_t length) |
| | Hash bytes with the DJB2 algorithm.
|
| |
| uint32_t | hash_update (uint32_t h, const void *data, size_t len) |
| | Continue a DJB2 hash with more data.
|
| |
Non-cryptographic hash.
◆ HASH_INIT
◆ hash()
| uint32_t hash |
( |
const uint8_t * |
bytes, |
|
|
const uint32_t |
length |
|
) |
| |
Hash bytes with the DJB2 algorithm.
- Parameters
-
| bytes | Data. |
| length | Length of bytes. |
- Returns
- Hash, 5381 for empty data.
◆ hash_update()
| uint32_t hash_update |
( |
uint32_t |
h, |
|
|
const void * |
data, |
|
|
size_t |
len |
|
) |
| |
Continue a DJB2 hash with more data.
Hashing data in chunks gives the same result as hash() on all of it:
uint32_t hash_update(uint32_t h, const void *data, size_t len)
Continue a DJB2 hash with more data.
#define HASH_INIT
Initial value for hash_update().
Definition hash.h:26
- Parameters
-
| h | Running hash, HASH_INIT to start. |
| data | Data. |
| len | Length of data. |
- Returns
- Updated hash.