poser
A C framework for POsix SERvices
|
Calculate non-cryptographic hashes of some data. More...
#include <poser/core/hash.h>
Public Member Functions | |
PSC_Hash * | PSC_Hash_create (int func, int flags) |
PSC_Hash default constructor. | |
uint64_t | PSC_Hash_bytes (PSC_Hash *self, const uint8_t *data, size_t size) |
Calculate a hash from any data. | |
uint64_t | PSC_Hash_string (PSC_Hash *self, const char *str) |
Calculate a hash from a string. | |
void | PSC_Hash_destroy (PSC_Hash *self) |
PSC_Hash destructor. | |
Calculate non-cryptographic hashes of some data.
This class hashes some given data using xxhash3.
uint64_t PSC_Hash_bytes | ( | PSC_Hash * | self, |
const uint8_t * | data, | ||
size_t | size | ||
) |
Calculate a hash from any data.
self | the PSC_Hash |
data | the data to hash |
size | the size of the data |
PSC_Hash * PSC_Hash_create | ( | int | func, |
int | flags | ||
) |
PSC_Hash default constructor.
Creates a new PSC_Hash with given options
func | the hash function to use, currently ignored, only xxhash3 is available |
flags | settings for the selected hash function, 0 means defaults. For xxhash3, 1 means use a random secret (created only once for all PSC_Hash instances) while hashing |
uint64_t PSC_Hash_string | ( | PSC_Hash * | self, |
const char * | str | ||
) |
Calculate a hash from a string.
self | the PSC_Hash |
str | the string to hash |