/*1* crc.h - CRC calculation routine2*3* Version 1.0.14*/56/*7* Copyright (C) 1995, Edward B. Hamrick8*9* Permission to use, copy, modify, and distribute this software and10* its documentation for any purpose and without fee is hereby granted,11* provided that the above copyright notice appear in all copies and12* that both that copyright notice and this permission notice appear in13* supporting documentation, and that the name of the copyright holders14* not be used in advertising or publicity pertaining to distribution of15* the software without specific, written prior permission. The copyright16* holders makes no representations about the suitability of this software17* for any purpose. It is provided "as is" without express or implied warranty.18*19* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS20* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,21* IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT22* OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF23* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER24* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE25* OF THIS SOFTWARE.26*/2728/*29* Changes from 1.0 to 1.0.1:30* Relicensed under the MIT license, with consent of the copyright holders.31* Claudio Matsuoka (Jan 11 2011)32*/3334/*35* This CRC algorithm is the same as that used in zip. Normally it36* should be initialized with 0xffffffff, and the final CRC stored37* should be crc ^ 0xffffffff.38*39* It implements the polynomial:40*41* 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+142*/4344#ifndef __CRC_H45#define __CRC_H4647#ifdef __cplusplus48extern "C" {49#endif5051unsigned long CrcUpdate( /* returns updated crc */52unsigned long crc, /* starting crc */53unsigned char *buffer, /* buffer to use to update crc */54long length /* length of buffer */55);5657#ifdef __cplusplus58}59#endif6061#endif626364