class CRC::CRC32

Overview

Implements the CRC32 algorithm.

Direct Known Subclasses

Defined in:

crc/crc32.cr

Constant Summary

TABLE = [0, 1996959894, 3993919788_i64, 2567524794_i64, 124634137, 1886057615, 3915621685_i64, 2657392035_i64, 249268274, 2044508324, 3772115230_i64, 2547177864_i64, 162941995, 2125561021, 3887607047_i64, 2428444049_i64, 498536548, 1789927666, 4089016648_i64, 2227061214_i64, 450548861, 1843258603, 4107580753_i64, 2211677639_i64, 325883990, 1684777152, 4251122042_i64, 2321926636_i64, 335633487, 1661365465, 4195302755_i64, 2366115317_i64, 997073096, 1281953886, 3579855332_i64, 2724688242_i64, 1006888145, 1258607687, 3524101629_i64, 2768942443_i64, 901097722, 1119000684, 3686517206_i64, 2898065728_i64, 853044451, 1172266101, 3705015759_i64, 2882616665_i64, 651767980, 1373503546, 3369554304_i64, 3218104598_i64, 565507253, 1454621731, 3485111705_i64, 3099436303_i64, 671266974, 1594198024, 3322730930_i64, 2970347812_i64, 795835527, 1483230225, 3244367275_i64, 3060149565_i64, 1994146192, 31158534, 2563907772_i64, 4023717930_i64, 1907459465, 112637215, 2680153253_i64, 3904427059_i64, 2013776290, 251722036, 2517215374_i64, 3775830040_i64, 2137656763, 141376813, 2439277719_i64, 3865271297_i64, 1802195444, 476864866, 2238001368_i64, 4066508878_i64, 1812370925, 453092731, 2181625025_i64, 4111451223_i64, 1706088902, 314042704, 2344532202_i64, 4240017532_i64, 1658658271, 366619977, 2362670323_i64, 4224994405_i64, 1303535960, 984961486, 2747007092_i64, 3569037538_i64, 1256170817, 1037604311, 2765210733_i64, 3554079995_i64, 1131014506, 879679996, 2909243462_i64, 3663771856_i64, 1141124467, 855842277, 2852801631_i64, 3708648649_i64, 1342533948, 654459306, 3188396048_i64, 3373015174_i64, 1466479909, 544179635, 3110523913_i64, 3462522015_i64, 1591671054, 702138776, 2966460450_i64, 3352799412_i64, 1504918807, 783551873, 3082640443_i64, 3233442989_i64, 3988292384_i64, 2596254646_i64, 62317068, 1957810842, 3939845945_i64, 2647816111_i64, 81470997, 1943803523, 3814918930_i64, 2489596804_i64, 225274430, 2053790376, 3826175755_i64, 2466906013_i64, 167816743, 2097651377, 4027552580_i64, 2265490386_i64, 503444072, 1762050814, 4150417245_i64, 2154129355_i64, 426522225, 1852507879, 4275313526_i64, 2312317920_i64, 282753626, 1742555852, 4189708143_i64, 2394877945_i64, 397917763, 1622183637, 3604390888_i64, 2714866558_i64, 953729732, 1340076626, 3518719985_i64, 2797360999_i64, 1068828381, 1219638859, 3624741850_i64, 2936675148_i64, 906185462, 1090812512, 3747672003_i64, 2825379669_i64, 829329135, 1181335161, 3412177804_i64, 3160834842_i64, 628085408, 1382605366, 3423369109_i64, 3138078467_i64, 570562233, 1426400815, 3317316542_i64, 2998733608_i64, 733239954, 1555261956, 3268935591_i64, 3050360625_i64, 752459403, 1541320221, 2607071920_i64, 3965973030_i64, 1969922972, 40735498, 2617837225_i64, 3943577151_i64, 1913087877, 83908371, 2512341634_i64, 3803740692_i64, 2075208622, 213261112, 2463272603_i64, 3855990285_i64, 2094854071, 198958881, 2262029012_i64, 4057260610_i64, 1759359992, 534414190, 2176718541_i64, 4139329115_i64, 1873836001, 414664567, 2282248934_i64, 4279200368_i64, 1711684554, 285281116, 2405801727_i64, 4167216745_i64, 1634467795, 376229701, 2685067896_i64, 3608007406_i64, 1308918612, 956543938, 2808555105_i64, 3495958263_i64, 1231636301, 1047427035, 2932959818_i64, 3654703836_i64, 1088359270, 936918000, 2847714899_i64, 3736837829_i64, 1202900863, 817233897, 3183342108_i64, 3401237130_i64, 1404277552, 615818150, 3134207493_i64, 3453421203_i64, 1423857449, 601450431, 3009837614_i64, 3294710456_i64, 1567103746, 711928724, 3020668471_i64, 3272380065_i64, 1510334235, 755167117] of UInt32

Generated by ./pycrc.py --algorithm=table-driven --model=crc-32 --generate=c

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class CRC::Base(UInt32)

<<(data) <<, checksum : UINT checksum, digest_size : Int32 digest_size, final_impl(dst : Bytes) : Nil final_impl, reset_impl : Nil reset_impl, update_impl(data : Bytes) : Nil update_impl

Constructor methods inherited from class CRC::Base(UInt32)

new(crc : UINT = self.class.init_crc) new

Class methods inherited from class CRC::Base(UInt32)

checksum(data) : UINT checksum, init_crc : UINT init_crc, xor_mask : UINT xor_mask

Constructor Detail

def self.new(crc : UINT = self.class.init_crc) #

Initializes the CRC instance.


[View source]

Class Method Detail

def self.init_crc #

Initial CRC value.


[View source]
def self.xor_mask #

CRC XOR mask.


[View source]

Instance Method Detail

def final_impl(dst : Bytes) : Nil #

The packed CRC value.


[View source]
def update_impl(data : Bytes) : Nil #

Updates the CRC32 checksum.

@param [String] data The data to update the checksum with.


[View source]