ChecksumCodec

Provides methods to create a "checksum codec" (encodes a bit-range to a bit-checksum and decodes bits to a bit-range).

class Object
trait Matchable
class Any

Type members

Classlikes

case
class Mismatch(bits: BitVector, expected: BitVector, actual: BitVector, context: List[String]) extends Err

Value members

Concrete methods

def apply(encoder: Encoder[BitVector], range: Decoder[Long]): Codec[BitVector]

Returns a codec that encodes a bit-range to a bit-checksum and decodes bits to a bit-range.

Returns a codec that encodes a bit-range to a bit-checksum and decodes bits to a bit-range.

Value Params
encoder

encodes a bit-range to a bit-checksum

range

decodes the size of a bit-range

def apply(encoder: Encoder[BitVector], range: Decoder[Long], padding: Long): Codec[BitVector]

Returns a codec that encodes a bit-range to a bit-checksum and decodes bits to a bit-range.

Returns a codec that encodes a bit-range to a bit-checksum and decodes bits to a bit-range.

Value Params
encoder

encodes a bit-range to a bit-checksum

padding

size padding for the bit-range

range

decodes the (un-padded) size of a bit-range

def apply(encoder: Encoder[ByteVector], range: Decoder[Int], padding: Int): Codec[BitVector]

Returns a codec that encodes a bit-range to a bit-checksum and decodes bits to a bit-range.

Returns a codec that encodes a bit-range to a bit-checksum and decodes bits to a bit-range.

Value Params
encoder

encodes a byte-range to a byte-checksum

padding

size padding for the byte-range

range

decodes the (un-padded) size of a byte-range

def apply(length: Long, f: BitVector => BitVector, range: Decoder[Long], padding: Long): Codec[BitVector]

Returns a codec that encodes a bit-range to a bit-checksum and decodes bits to a bit-range.

Returns a codec that encodes a bit-range to a bit-checksum and decodes bits to a bit-range.

Value Params
f

computes bit-checksum

length

the bit-length of the checksum

padding

size padding for the bit-range

range

decodes the (un-padded) size of a bit-range

def apply(length: Int, f: ByteVector => ByteVector, range: Decoder[Int], padding: Int): Codec[BitVector]

Returns a codec that encodes a bit-range to a bit-checksum and decodes bits to a bit-range.

Returns a codec that encodes a bit-range to a bit-checksum and decodes bits to a bit-range.

Value Params
f

computes byte-checksum

length

the byte-length of the checksum

padding

size padding for the byte-range

range

decodes the (un-padded) size of a byte-range

def xor(length: Long, range: Decoder[Long], padding: Long): Codec[BitVector]

Returns a codec that encodes a bit-range to an XORed bit-checksum and decodes bits to a bit-range.

Returns a codec that encodes a bit-range to an XORed bit-checksum and decodes bits to a bit-range.

Value Params
length

the bit-length of the checksum

padding

size padding for the bit-range

range

decodes the (un-padded) size of a bit-range

def xor(length: Int, range: Decoder[Int], padding: Int): Codec[BitVector]

Returns a codec that encodes a bit-range to an XORed bit-checksum and decodes bits to a bit-range.

Returns a codec that encodes a bit-range to an XORed bit-checksum and decodes bits to a bit-range.

Value Params
length

the byte-length of the checksum

padding

size padding for the byte-range

range

decodes the (un-padded) size of a byte-range