24 namespace Lucene.Net.Support
28 private static readonly UInt32[] crcTable = InitializeCRCTable();
30 private static UInt32[] InitializeCRCTable()
32 UInt32[] crcTable =
new UInt32[256];
33 for (UInt32 n = 0; n < 256; n++)
36 for (
int k = 8; --k >= 0; )
39 c = 0xedb88320 ^ (c >> 1);
48 private UInt32 crc = 0;
54 return crc & 0xffffffffL;
63 public void Update(
int bval)
66 c = crcTable[(c ^ bval) & 0xff] ^ (c >> 8);
70 public void Update(byte[] buf,
int off,
int len)
74 c = crcTable[(c ^ buf[off++]) & 0xff] ^ (c >> 8);
78 public void Update(byte[] buf)
80 Update(buf, 0, buf.Length);