objc

Data Structures | Macros | Enumerations | Functions
hash.h File Reference

Methods for hash generation from data. More...

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
Include dependency graph for hash.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  sys_hash_t
 Hash context structure. More...
 

Macros

#define SYS_HASH_SIZE   32
 Size of the hash. More...
 
#define SYS_HASH_CTX_SIZE   128
 Size of the hash context buffer. More...
 

Enumerations

enum  sys_hash_algorithm_t { sys_hash_md5, sys_hash_sha256 }
 Hash algorithm identifiers. More...
 

Functions

sys_hash_t sys_hash_init (sys_hash_algorithm_t algorithm)
 Initializes a new hash context for the specified algorithm. More...
 
size_t sys_hash_size (sys_hash_t *hash)
 Returns the size of the hash in bytes. More...
 
bool sys_hash_update (sys_hash_t *hash, const void *data, size_t size)
 Updates the hash context with new data. More...
 
const uint8_t * sys_hash_finalize (sys_hash_t *hash)
 Finalizes the hash computation and returns the hash value. More...
 
uintptr_t sys_hash_djb2 (const char *str)
 djb2 hash function for strings More...
 

Detailed Description

Methods for hash generation from data.

Definition in file hash.h.