2018-01-01 05:58:30 +08:00
|
|
|
/*
|
|
|
|
author: Christian Bender
|
|
|
|
This file contains the public interface
|
|
|
|
|
|
|
|
Overview about hash-functions:
|
|
|
|
|
|
|
|
- sdbm
|
|
|
|
- djb2
|
|
|
|
- xor8 (8 bit)
|
|
|
|
- adler_32 (32 bits)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __HASH__H
|
|
|
|
#define __HASH__H
|
|
|
|
|
|
|
|
/*
|
|
|
|
sdbm: implements the sdbm hash-algorithm
|
|
|
|
returns a whole number of type long long.
|
|
|
|
*/
|
|
|
|
long long sdbm(char[]);
|
|
|
|
|
|
|
|
/*
|
|
|
|
djb2: implements the djb2 hash-algorithm
|
|
|
|
returns a whole number of type long long.
|
|
|
|
*/
|
|
|
|
long long djb2(char[]);
|
|
|
|
|
|
|
|
/*
|
|
|
|
xor8: implements the xor8 hash-algorithm
|
|
|
|
returns a whole number of type char.
|
|
|
|
length: 8 bit
|
|
|
|
*/
|
|
|
|
char xor8(char[]);
|
|
|
|
|
|
|
|
/*
|
|
|
|
adler_32: implements the adler-32 hash-algorithm
|
|
|
|
returns a whole number of type int.
|
|
|
|
length: 32 bit
|
|
|
|
assumes: int has a length of 32 bits.
|
|
|
|
*/
|
|
|
|
int adler_32(char[]);
|
|
|
|
|
2019-10-13 18:13:00 +08:00
|
|
|
/*
|
|
|
|
crc32: implements the crc-32 hash-algorithm
|
|
|
|
returns the checksum byte for the passed byte
|
|
|
|
*/
|
|
|
|
int crc32(char[]);
|
|
|
|
|
|
|
|
|
2018-01-01 05:58:30 +08:00
|
|
|
#endif
|