feisty meow concerns codebase  2.140
structures::checksums Class Reference

#include <checksums.h>

Static Public Member Functions

static basis::abyte byte_checksum (const basis::abyte *data, int length)
 simple byte-sized checksum based on additive roll-over. More...
 
static basis::un_int short_checksum (const basis::abyte *data, int length)
 simple shorty checksum based on additive roll-over. More...
 
static basis::un_short fletcher_checksum (const basis::abyte *data, int length)
 A positionally computed error detection value. More...
 
static basis::un_short rolling_fletcher_checksum (basis::un_short previous, const basis::abyte *data, int len)
 Fletcher checksums applied to streaming data. More...
 
static unsigned int bizarre_checksum (const basis::abyte *data, int length)
 A different type of checksum with somewhat unknown properties. More...
 
static basis::un_int hash_bytes (const void *key_data, int key_length)
 returns a value that can be used for indexing into a hash table. More...
 

Detailed Description

Definition at line 26 of file checksums.h.

Member Function Documentation

◆ bizarre_checksum()

unsigned int structures::checksums::bizarre_checksum ( const basis::abyte data,
int  length 
)
static

A different type of checksum with somewhat unknown properties.

It attempts to be incorporate positioning of the bytes.

Definition at line 25 of file checksums.cpp.

References structures::HIGHEST_MOD_VALUE.

◆ byte_checksum()

abyte structures::checksums::byte_checksum ( const basis::abyte data,
int  length 
)
static

simple byte-sized checksum based on additive roll-over.

Definition at line 60 of file checksums.cpp.

◆ fletcher_checksum()

basis::un_short structures::checksums::fletcher_checksum ( const basis::abyte data,
int  length 
)
static

A positionally computed error detection value.

Definition at line 35 of file checksums.cpp.

◆ hash_bytes()

basis::un_int structures::checksums::hash_bytes ( const void *  key_data,
int  key_length 
)
static

returns a value that can be used for indexing into a hash table.

the returned value is loosely based on the "key_data" and the "key_length" we are provided with.

Definition at line 74 of file checksums.cpp.

Referenced by structures::rotating_byte_hasher::hash().

◆ rolling_fletcher_checksum()

basis::un_short structures::checksums::rolling_fletcher_checksum ( basis::un_short  previous,
const basis::abyte data,
int  len 
)
static

Fletcher checksums applied to streaming data.

this is not strictly a fletcher checksum, but it uses the normal fletcher checksum on the specified data and XORs it with the "previous" value of the checksum. this leads to a regenerable number that should always be the same if done on the same data using the same chunking factor (the "len"), although of course the last piece of data does not have to be "len" bytes.

Definition at line 56 of file checksums.cpp.

◆ short_checksum()

basis::un_int structures::checksums::short_checksum ( const basis::abyte data,
int  length 
)
static

simple shorty checksum based on additive roll-over.

Definition at line 67 of file checksums.cpp.


The documentation for this class was generated from the following files: