class RemiLib::Digest::Crc64

Overview

A 64-bit Cyclic Redundancy Check.

Defined in:

remilib/digest/crc64.cr

Constant Summary

ECMA_POLY = 14514072000185962306_u64

The polynomial as defined in ECMA 182.

ISO_POLY = 15564440312192434176_u64

The polynomial as defined in ISO 3309.

Constructors

Instance Method Summary

Constructor Detail

def self.new(poly : UInt64 = ECMA_POLY) #

Creates a new Crc64 instance.


[View source]

Instance Method Detail

def crc : UInt64 #

The current checksum. This is updated each time #update is called.


[View source]
def polynomial : UInt64 #

The polynomial that this instance is currently using.


[View source]
def polynomial=(polynomial : UInt64) : Nil #

Changes the polynomial that is used. NOTE: This resets this instance to the initial state as well.


[View source]
def reset : Nil #

Resets this instance to the initial state.


[View source]
def update(value : UInt8) : UInt64 #

Updates the checksum with value. Returns the new checksum.


[View source]
def update(buf : Bytes | Array(UInt8)) : UInt64 #

Updates the checksum with the bytes in buf. Returns the new checksum.


[View source]