class CRC::CRC5

Overview

Implements the CRC5 algorithm.

Defined in:

crc/crc5.cr

Constant Summary

TABLE = [0, 112, 224, 144, 136, 248, 104, 24, 88, 40, 184, 200, 208, 160, 48, 64, 176, 192, 80, 32, 56, 72, 216, 168, 232, 152, 8, 120, 96, 16, 128, 240, 40, 88, 200, 184, 160, 208, 64, 48, 112, 0, 144, 224, 248, 136, 24, 104, 152, 232, 120, 8, 16, 96, 240, 128, 192, 176, 32, 80, 72, 56, 168, 216, 80, 32, 176, 192, 216, 168, 56, 72, 8, 120, 232, 152, 128, 240, 96, 16, 224, 144, 0, 112, 104, 24, 136, 248, 184, 200, 88, 40, 48, 64, 208, 160, 120, 8, 152, 232, 240, 128, 16, 96, 32, 80, 192, 176, 168, 216, 72, 56, 200, 184, 40, 88, 64, 48, 160, 208, 144, 224, 112, 0, 24, 104, 248, 136, 160, 208, 64, 48, 40, 88, 200, 184, 248, 136, 24, 104, 112, 0, 144, 224, 16, 96, 240, 128, 152, 232, 120, 8, 72, 56, 168, 216, 192, 176, 32, 80, 136, 248, 104, 24, 0, 112, 224, 144, 208, 160, 48, 64, 88, 40, 184, 200, 56, 72, 216, 168, 176, 192, 80, 32, 96, 16, 128, 240, 232, 152, 8, 120, 240, 128, 16, 96, 120, 8, 152, 232, 168, 216, 72, 56, 32, 80, 192, 176, 64, 48, 160, 208, 200, 184, 40, 88, 24, 104, 248, 136, 144, 224, 112, 0, 216, 168, 56, 72, 80, 32, 176, 192, 128, 240, 96, 16, 8, 120, 232, 152, 104, 24, 136, 248, 224, 144, 0, 112, 48, 64, 208, 160, 184, 200, 88, 40] of UInt8

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

Constructors

Class Method Summary

Instance Method Summary

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

<<(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(UInt8)

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

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

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

Constructor Detail

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

Initializes the CRC5 instance.


[View source]

Class Method Detail

def self.crc_mask : UInt8 #

The CRC 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 CRC5 checksum.

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


[View source]