Phoenix
Object-oriented orthogonally persistent operating system
crc.h
Go to the documentation of this file.
00001 /*
00002  * /phoenix/include/common/crc.h
00003  *
00004  * This file is a part of Phoenix operating system.
00005  * Copyright (c) 2011-2012, Artyom Lebedev <artyom.lebedev@gmail.com>
00006  * All rights reserved.
00007  * See COPYING file for copyright details.
00008  */
00009 
00014 #ifndef CRC_H_
00015 #define CRC_H_
00016 
00018 class Crc32 {
00019 public:
00024     Crc32(u32 polynomial = 0x04c11db7);
00033     u32 Calculate(void *buf, size_t size, u32 crc = 0xffffffff);
00034 private:
00035     u32 _polynomial;
00036     u32 _crcTable[256];
00037 };
00038 
00039 
00040 #endif /* CRC_H_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines