3#if !defined(SANE_CPP_LIBRARIES_HASHING)
4#define SANE_CPP_LIBRARIES_HASHING 1
34#define SANE_CPP_NO_DISCARD
36#define SANE_CPP_NO_DISCARD __attribute__((warn_unused_result))
89#undef SANE_CPP_NO_DISCARD
unsigned char uint8_t
Platform independent (1) byte unsigned int.
Definition: PrimitiveTypes.h:36
unsigned long long uint64_t
Platform independent (8) bytes unsigned int.
Definition: PrimitiveTypes.h:42
SANE_CPP_NO_DISCARD bool sc_hashing_get(sc_hashing_t *hashing, sc_hashing_result_t *result)
Obtain the actual hash of data added through sc_hashing_add.
sc_hashing_type
Type of hashing algorithm to use.
Definition: sc_hashing.h:46
void sc_hashing_close(sc_hashing_t *hashing)
Releases os resources allocated by sc_hashing_init.
SANE_CPP_NO_DISCARD bool sc_hashing_init(sc_hashing_t *hashing, sc_hashing_type type)
Initializes OS objects to compute hash (call sc_hashing_close when done).
SANE_CPP_NO_DISCARD bool sc_hashing_add(sc_hashing_t *hashing, sc_hashing_span_t span)
Add data to hash computation. Can be called multiple times to hash data iteratively.
@ SC_HASHING_TYPE_SHA1
Computes SHA1 Hash.
Definition: sc_hashing.h:48
@ SC_HASHING_TYPE_MD5
Computes MD5 Hash.
Definition: sc_hashing.h:47
@ SC_HASHING_TYPE_SHA256
Computes SHA256 Hash.
Definition: sc_hashing.h:49
Hash result.
Definition: sc_hashing.h:60
size_t size
Length of the computed hash.
Definition: sc_hashing.h:62
Just a generic data span.
Definition: sc_hashing.h:67
const void * data
Pointer to data.
Definition: sc_hashing.h:68
size_t length
Length of the data (in bytes)
Definition: sc_hashing.h:69
Opaque object holding state of hashing.
Definition: sc_hashing.h:54