Fletcher32

Fletcher32 checksum algorithm. More...

Detailed Description

Fletcher32 checksum algorithm.

Files

file  fletcher32.h
 

Functions

uint32_t fletcher32 (const uint16_t *buf, size_t words)
 Fletcher's 32 bit checksum. More...
 

Function Documentation

◆ fletcher32()

uint32_t fletcher32 ( const uint16_t *  buf,
size_t  words 
)

Fletcher's 32 bit checksum.

found on http://en.wikipedia.org/w/index.php?title=Fletcher%27s_checksum&oldid=661273016#Optimizations

Note
the returned sum is never 0
pay attention to alignment issues since this operates on an input buffer containing 16 bit words, not bytes.
Parameters
bufinput buffer to hash
wordslength of buffer, in 16 bit words
Returns
32 bit sized hash in the interval [1..2^32]