Mercurial > vba-linux
comparison src/win32/7zip/7z/CPP/7zip/Compress/BZip2Crc.cpp @ 1:f9f4f1b99eed
importing src directory
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 03 Mar 2012 10:31:27 -0600 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:8ced16adf2e1 | 1:f9f4f1b99eed |
---|---|
1 // BZip2Crc.cpp | |
2 | |
3 #include "StdAfx.h" | |
4 | |
5 #include "BZip2Crc.h" | |
6 | |
7 UInt32 CBZip2Crc::Table[256]; | |
8 | |
9 static const UInt32 kBZip2CrcPoly = 0x04c11db7; /* AUTODIN II, Ethernet, & FDDI */ | |
10 | |
11 void CBZip2Crc::InitTable() | |
12 { | |
13 for (UInt32 i = 0; i < 256; i++) | |
14 { | |
15 UInt32 r = (i << 24); | |
16 for (int j = 8; j > 0; j--) | |
17 r = (r & 0x80000000) ? ((r << 1) ^ kBZip2CrcPoly) : (r << 1); | |
18 Table[i] = r; | |
19 } | |
20 } | |
21 | |
22 class CBZip2CrcTableInit | |
23 { | |
24 public: | |
25 CBZip2CrcTableInit() { CBZip2Crc::InitTable(); } | |
26 } g_BZip2CrcTableInit; |