/* 
 * File:   crc32.h
 * Author: vicror
 *
 * Created on October 12, 2009, 10:37 PM
 */

#ifndef _CRC32_H
#define	_CRC32_H

/* Use
    checksum::crc32_context ctx;
    checksum::crc32_starts(&ctx);
    unsigned char ch[]="To be or not to be.\n";
    checksum::crc32_update(&ctx,  ch, strlen((const char *)ch));
    printf("%4X\n", checksum::crc32_finish(&ctx));

 */
#include "base.h"
namespace  checksum
{

  typedef struct
  {
    uint32 crc;
  }
  crc32_context;

  void  crc32_starts( crc32_context *ctx );
  void  crc32_update( crc32_context *ctx, uint8 *input, uint32 length );
  uint32  crc32_finish( crc32_context *ctx);

}


#endif	/* _CRC32_H */

