39 #define SYS_HASH_SIZE 32 48 #define SYS_HASH_CTX_SIZE 128 size_t sys_hash_size(sys_hash_t *hash)
Returns the size of the hash in bytes.
sys_hash_algorithm_t
Hash algorithm identifiers.
void * ptr
Pointer to external hash context (e.g., OpenSSL EVP_MD_CTX)
MD5 hash algorithm (128-bit output, not cryptographically secure)
#define SYS_HASH_SIZE
Size of the hash.
sys_hash_t sys_hash_init(sys_hash_algorithm_t algorithm)
Initializes a new hash context for the specified algorithm.
SHA-256 hash algorithm (256-bit output, cryptographically secure)
bool sys_hash_update(sys_hash_t *hash, const void *data, size_t size)
Updates the hash context with new data.
const uint8_t * sys_hash_finalize(sys_hash_t *hash)
Finalizes the hash computation and returns the hash value.
#define SYS_HASH_CTX_SIZE
Size of the hash context buffer.
uintptr_t sys_hash_djb2(const char *str)
djb2 hash function for strings
sys_hash_algorithm_t algorithm
The hash algorithm being used for this context.