u_hash.h File Reference

Hash functions. More...

Include dependency graph for u_hash.h:

This graph shows which files directly or indirectly include this file:

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


Detailed Description

Hash functions.

Author:
Jose Fonseca <jfonseca@vmware.com>

Definition in file u_hash.h.


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 }


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