Fletcher16 checksum algorithm. More...
Fletcher16 checksum algorithm.
Files | |
file | fletcher16.h |
Data Structures | |
struct | fletcher16_ctx_t |
Fletcher's 16 bit checksum context struct. More... | |
Functions | |
uint16_t | fletcher16 (const uint8_t *buf, size_t bytes) |
Fletcher's 16 bit checksum. More... | |
void | fletcher16_init (fletcher16_ctx_t *ctx) |
Initialize a fletcher16 context. More... | |
void | fletcher16_update (fletcher16_ctx_t *ctx, const uint8_t *data, size_t len) |
Update the fletcher16 context with new data. More... | |
uint16_t | fletcher16_finish (fletcher16_ctx_t *ctx) |
Finalize the checksum operation and return the checksum. More... | |
uint16_t fletcher16 | ( | const uint8_t * | buf, |
size_t | bytes | ||
) |
Fletcher's 16 bit checksum.
found on http://en.wikipedia.org/w/index.php?title=Fletcher%27s_checksum&oldid=661273016#Optimizations
buf | input buffer to hash |
bytes | length of buffer, in bytes |
uint16_t fletcher16_finish | ( | fletcher16_ctx_t * | ctx | ) |
Finalize the checksum operation and return the checksum.
[in] | ctx | fletcher16 context |
void fletcher16_init | ( | fletcher16_ctx_t * | ctx | ) |
Initialize a fletcher16 context.
Multi-part version of fletcher16_full.
[in] | ctx | fletcher16 context to initialize |
void fletcher16_update | ( | fletcher16_ctx_t * | ctx, |
const uint8_t * | data, | ||
size_t | len | ||
) |
Update the fletcher16 context with new data.
[in] | ctx | fletcher16 context |
[in] | data | Data to add to the context |
[in] | len | Length of the data |