Tesseract
3.02
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
Functions
hashfn.h File Reference
#include "
host.h
"
Go to the source code of this file.
Functions
inT32
hash
(
inT32
bits, void *key,
inT32
keysize)
Function Documentation
inT32
hash
(
inT32
bits
,
void *
key
,
inT32
keysize
)
Definition at line
30
of file
hashfn.cpp
.
34
{
35
inT32
bitindex;
//current bit count
36
uinT32
keybits;
//bit buffer
37
uinT32
hcode;
//current hash code
38
uinT32
mask;
//bit mask
39
40
mask = (1 << bits) - 1;
41
keysize *= 8;
//in bits
42
bitindex = 0;
43
keybits = 0;
44
hcode = 0;
45
do
{
46
while
(keysize > 0 && bitindex <= 24) {
47
keybits |= *((
uinT8
*) key) << bitindex;
48
key = (
uinT8
*) key + 1;
49
bitindex += 8;
50
keysize -= 8;
51
}
52
hcode ^= keybits & mask;
//key new key
53
keybits >>= bits;
54
}
55
while
(keysize > 0);
56
return
hcode;
//initial hash
57
}
inT32
int inT32
Definition:
host.h:102
uinT8
unsigned char uinT8
Definition:
host.h:99
uinT32
unsigned int uinT32
Definition:
host.h:103
home
abuild
rpmbuild
BUILD
tesseract-ocr-3.02.02
ccutil
hashfn.h
Generated on Wed Apr 2 2014 09:07:13 for Tesseract by
1.8.6