mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-14 08:11:35 -06:00
4.44 beta
This commit is contained in:
committed by
Kornel Lesiński
parent
804edc5756
commit
d9666cf046
26
CPP/7zip/Compress/BZip2/BZip2CRC.cpp
Executable file
26
CPP/7zip/Compress/BZip2/BZip2CRC.cpp
Executable file
@@ -0,0 +1,26 @@
|
||||
// BZip2CRC.cpp
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "BZip2CRC.h"
|
||||
|
||||
UInt32 CBZip2CRC::Table[256];
|
||||
|
||||
static const UInt32 kBZip2CRCPoly = 0x04c11db7; /* AUTODIN II, Ethernet, & FDDI */
|
||||
|
||||
void CBZip2CRC::InitTable()
|
||||
{
|
||||
for (UInt32 i = 0; i < 256; i++)
|
||||
{
|
||||
UInt32 r = (i << 24);
|
||||
for (int j = 8; j > 0; j--)
|
||||
r = (r & 0x80000000) ? ((r << 1) ^ kBZip2CRCPoly) : (r << 1);
|
||||
Table[i] = r;
|
||||
}
|
||||
}
|
||||
|
||||
class CBZip2CRCTableInit
|
||||
{
|
||||
public:
|
||||
CBZip2CRCTableInit() { CBZip2CRC::InitTable(); }
|
||||
} g_BZip2CRCTableInit;
|
||||
Reference in New Issue
Block a user