feisty meow concerns codebase 2.140
checksums.h
Go to the documentation of this file.
1#ifndef CHECKSUMS_GROUP
2#define CHECKSUMS_GROUP
3
4/*****************************************************************************\
5* *
6* Name : checksums group *
7* Author : Chris Koeritz *
8* *
9*******************************************************************************
10* Copyright (c) 1992-$now By Author. This program is free software; you can *
11* redistribute it and/or modify it under the terms of the GNU General Public *
12* License as published by the Free Software Foundation; either version 2 of *
13* the License or (at your option) any later version. This is online at: *
14* http://www.fsf.org/copyleft/gpl.html *
15* Please send any updates to: fred@gruntose.com *
16\*****************************************************************************/
17
18#include <basis/definitions.h>
19
20/* @file checksums.h
21 A collection of useful checksum calculators.
22*/
23
24namespace structures {
25
27{
28public:
29
30 static basis::abyte byte_checksum(const basis::abyte *data, int length);
32
33 static basis::un_int short_checksum(const basis::abyte *data, int length);
35
36 static basis::un_short fletcher_checksum(const basis::abyte *data, int length);
38
39 static basis::un_short rolling_fletcher_checksum(basis::un_short previous, const basis::abyte *data, int len);
41
48 static unsigned int bizarre_checksum(const basis::abyte *data, int length);
50
52 static basis::un_int hash_bytes(const void *key_data, int key_length);
54
56};
57
58} //namespace.
59
60#endif
61
static basis::un_int short_checksum(const basis::abyte *data, int length)
simple shorty checksum based on additive roll-over.
Definition checksums.cpp:67
static basis::un_short rolling_fletcher_checksum(basis::un_short previous, const basis::abyte *data, int len)
Fletcher checksums applied to streaming data.
Definition checksums.cpp:56
static basis::abyte byte_checksum(const basis::abyte *data, int length)
simple byte-sized checksum based on additive roll-over.
Definition checksums.cpp:60
static unsigned int bizarre_checksum(const basis::abyte *data, int length)
A different type of checksum with somewhat unknown properties.
Definition checksums.cpp:25
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.
Definition checksums.cpp:74
static basis::un_short fletcher_checksum(const basis::abyte *data, int length)
A positionally computed error detection value.
Definition checksums.cpp:35
Constants and objects used throughout HOOPLE.
unsigned char abyte
A fairly important unit which is seldom defined...
Definition definitions.h:51
unsigned int un_int
Abbreviated name for unsigned integers.
Definition definitions.h:62
unsigned short un_short
Abbreviated name for unsigned short integers.
Definition definitions.h:64
A dynamic container class that holds any kind of object via pointers.
Definition amorph.h:55