ChecksumCodec
object 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
Value members
Methods
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
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
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.
- 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.
- 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
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