C bindings for Hashing library. More...
Classes | |
struct | sc_hashing_t |
Opaque object holding state of hashing. More... | |
struct | sc_hashing_result_t |
Hash result. More... | |
struct | sc_hashing_span_t |
Just a generic data span. More... | |
Macros | |
#define | SANE_CPP_NO_DISCARD __attribute__((warn_unused_result)) |
Enumerations | |
enum | sc_hashing_type { SC_HASHING_TYPE_MD5 , SC_HASHING_TYPE_SHA1 , SC_HASHING_TYPE_SHA256 } |
Type of hashing algorithm to use. More... | |
Functions | |
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). More... | |
void | sc_hashing_close (sc_hashing_t *hashing) |
Releases os resources allocated by sc_hashing_init. More... | |
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. More... | |
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. More... | |
C bindings for Hashing library.
Sample usage:
enum sc_hashing_type |
SANE_CPP_NO_DISCARD bool sc_hashing_add | ( | sc_hashing_t * | hashing, |
sc_hashing_span_t | span | ||
) |
#include <sc_hashing.h>
Add data to hash computation. Can be called multiple times to hash data iteratively.
void sc_hashing_close | ( | sc_hashing_t * | hashing | ) |
#include <sc_hashing.h>
Releases os resources allocated by sc_hashing_init.
SANE_CPP_NO_DISCARD bool sc_hashing_get | ( | sc_hashing_t * | hashing, |
sc_hashing_result_t * | result | ||
) |
#include <sc_hashing.h>
Obtain the actual hash of data added through sc_hashing_add.
SANE_CPP_NO_DISCARD bool sc_hashing_init | ( | sc_hashing_t * | hashing, |
sc_hashing_type | type | ||
) |
#include <sc_hashing.h>
Initializes OS objects to compute hash (call sc_hashing_close when done).