General functions for hashing data.
More...
|
uint32_t | HASH_fnv1a_32 (const void *data_in, size_t num_bytes) |
| Calculate the 32-bit fnv1a non-crypto hash of a block of data. More...
|
|
uint64_t | HASH_fnv1a_64 (const void *data_in, size_t num_bytes) |
| Calculate the 64-bit fnv1a non-crypto hash of a block of data. More...
|
|
void | HASH_fnv1a_64_stream (const void *data_in, size_t num_bytes, uint64_t *hash) |
| Streaming version of HASH_fnv1a_64. More...
|
|
uint32_t | HASH_CRC32 (uint8_t *data, uint32_t dataLen) |
| Calculate the CRC32 hash of a block of data. More...
|
|
void | HASH_CRC32_stream (uint8_t *data, uint32_t dataLen, uint32_t *crc) |
| Streaming version of HASH_CRC32. More...
|
|
General functions for hashing data.
◆ HASH_CRC32()
uint32_t HASH_CRC32 |
( |
uint8_t * |
data, |
|
|
uint32_t |
dataLen |
|
) |
| |
Calculate the CRC32 hash of a block of data.
- Parameters
-
data | The data to hash |
dataLen | The sizeof the data to be hashed (in bytes) |
- Returns
- 32-bit CRC hash
◆ HASH_CRC32_stream()
void HASH_CRC32_stream |
( |
uint8_t * |
data, |
|
|
uint32_t |
dataLen, |
|
|
uint32_t * |
crc |
|
) |
| |
Streaming version of HASH_CRC32.
Usage notes: This function leaves out
- The initialisation of the CRC to 0xFFFFFFFF at the beginning, and
- the one's complement operation at the end. So these two steps have to be handled outside of this function, by the code that uses it. (For example, see HASH_CRC32, which uses HASH_CRC32_stream).
- Parameters
-
data | The data to hash |
dataLen | The sizeof the data to be hashed (in bytes) |
crc | Output variable into which the (partial) crc computation is stored |
◆ HASH_fnv1a_32()
uint32_t HASH_fnv1a_32 |
( |
const void * |
data_in, |
|
|
size_t |
num_bytes |
|
) |
| |
Calculate the 32-bit fnv1a non-crypto hash of a block of data.
- Parameters
-
data_in | The data to hash |
num_bytes | The sizeof the data to be hashed (in bytes) |
- Returns
- 32-bit fnv1a non-crypto hash
◆ HASH_fnv1a_64()
uint64_t HASH_fnv1a_64 |
( |
const void * |
data_in, |
|
|
size_t |
num_bytes |
|
) |
| |
Calculate the 64-bit fnv1a non-crypto hash of a block of data.
- Parameters
-
data_in | The data to hash |
num_bytes | The sizeof the data to be hashed (in bytes) |
- Returns
- 64-bit fnv1a non-crypto hash
◆ HASH_fnv1a_64_stream()
void HASH_fnv1a_64_stream |
( |
const void * |
data_in, |
|
|
size_t |
num_bytes, |
|
|
uint64_t * |
hash |
|
) |
| |
Streaming version of HASH_fnv1a_64.
Usage note: This function leaves out the initialisation of the hash to the basis64 at the beginning. So this has to be done before this function is done. (For example, see HASH_fnv1a_64, which uses HASH_fnv1a_64_stream).
- Parameters
-
data_in | The data to hash |
num_bytes | The sizeof the data to be hashed (in bytes) |
hash | Output variable into which the (partial) hash computation is stored Should be initialised to basis64 (14695981039346656037ULL) |