u_hash.c File Reference

Hash functions implementation. More...

Include dependency graph for u_hash.c:

Go to the source code of this file.

Functions

uint32_t util_hash_crc32 (const void *data, size_t size)
 
See also:
http://www.w3.org/TR/PNG/#D-CRCAppendix


Variables

static const uint32_t util_crc32_table [256]


Detailed Description

Hash functions implementation.

Author:
Jose Fonseca

Definition in file u_hash.c.


Function Documentation

uint32_t util_hash_crc32 ( const void *  data,
size_t  size 
)

See also:
http://www.w3.org/TR/PNG/#D-CRCAppendix

Definition at line 112 of file u_hash.c.

References util_crc32_table.

00113 {
00114    uint8_t *p = (uint8_t *)data;
00115    uint32_t crc = 0xffffffff;
00116  
00117    while (size--)
00118       crc = util_crc32_table[(crc ^ *p++) & 0xff] ^ (crc >> 8);
00119    
00120    return crc;
00121 }


Variable Documentation

const uint32_t util_crc32_table[256] [static]

Definition at line 40 of file u_hash.c.


Generated on Tue Sep 29 06:25:28 2009 for Gallium3D by  doxygen 1.5.4