static ZipCrc32() { // Table のメモリは Unmanaged メモリを初期化時に動的に確保し、その後一生解放しない。 // 厳密にはメモリリークであるが、少量かつ 1 回のみであるから、問題無いのである。 Table = (uint *)MemoryHelper.AllocUnmanagedMemory(sizeof(int) * 256); uint poly = 0xEDB88320; uint u, i, j; for (i = 0; i < 256; i++) { u = i; for (j = 0; j < 8; j++) { if ((u & 0x1) != 0) { u = (u >> 1) ^ poly; } else { u >>= 1; } } Table[i] = u; } }