]> FriiDump Source - friidump.git/blob - libmultihash/crc32.h
FriiDump 0.5.3.15: close XGD1 geometry and lead-in capture
[friidump.git] / libmultihash / crc32.h
1 /*
2  * Copyright (c) 1995, Edward B. Hamrick
3  *
4  * Permission to use, copy, modify, distribute, and sell this software and
5  * its documentation for any purpose is hereby granted without fee, provided
6  * that
7  *
8  * (i)  the above copyright notice and the text in this "C" comment block
9  *      appear in all copies of the software and related documentation, and
10  *
11  * (ii) any modifications to this source file must be sent, via e-mail
12  *      to the copyright owner (currently hamrick@primenet.com) within
13  *      30 days of such modification.
14  *
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
18  *
19  * IN NO EVENT SHALL EDWARD B. HAMRICK BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
20  * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER
21  * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF
22  * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT OF
23  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
24  */
25
26 /*
27  * This CRC algorithm is the same as that used in zip.  Normally it
28  * should be initialized with 0xffffffff, and the final CRC stored
29  * should be crc ^ 0xffffffff.
30  *
31  * It implements the polynomial:
32  *
33  * x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1
34  */
35
36 #ifndef __CRC_H
37 #define __CRC_H
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 unsigned long CrcUpdate(          /* returns updated crc         */
44   unsigned long crc,              /* starting crc                */
45   unsigned char *buffer,          /* buffer to use to update crc */
46   long length                     /* length of buffer            */
47 );
48
49 #ifdef __cplusplus
50 }
51 #endif
52
53 #endif