Imports #
"errors"
"hash"
"internal/byteorder"
"sync"
"errors"
"hash"
"internal/byteorder"
"sync"
The ECMA polynomial, defined in ECMA 182.
const ECMA = 0xC96C5795D7870F42
The ISO polynomial, defined in ISO 3309 and used in HDLC.
const ISO = 0xD800000000000000
The size of a CRC-64 checksum in bytes.
const Size = 8
var buildSlicing8TablesOnce = *ast.CallExpr
const magic = "crc\x02"
const marshaledSize = *ast.BinaryExpr
var slicing8TableECMA *[8]Table
var slicing8TableISO *[8]Table
Table is a 256-word table representing the polynomial for efficient processing.
type Table [256]uint64
digest represents the partial evaluation of a checksum.
type digest struct {
crc uint64
tab *Table
}
func (d *digest) AppendBinary(b []byte) ([]byte, error)
func (d *digest) BlockSize() int
Checksum returns the CRC-64 checksum of data using the polynomial represented by the [Table].
func Checksum(data []byte, tab *Table) uint64
MakeTable returns a [Table] constructed from the specified polynomial. The contents of this [Table] must not be modified.
func MakeTable(poly uint64) *Table
func (d *digest) MarshalBinary() ([]byte, error)
New creates a new hash.Hash64 computing the CRC-64 checksum using the polynomial represented by the [Table]. Its Sum method will lay the value out in big-endian byte order. The returned Hash64 also implements [encoding.BinaryMarshaler] and [encoding.BinaryUnmarshaler] to marshal and unmarshal the internal state of the hash.
func New(tab *Table) hash.Hash64
func (d *digest) Reset()
func (d *digest) Size() int
func (d *digest) Sum(in []byte) []byte
func (d *digest) Sum64() uint64
func (d *digest) UnmarshalBinary(b []byte) error
Update returns the result of adding the bytes in p to the crc.
func Update(crc uint64, tab *Table, p []byte) uint64
func (d *digest) Write(p []byte) (n int, err error)
func buildSlicing8Tables()
func makeSlicingBy8Table(t *Table) *[8]Table
func makeTable(poly uint64) *Table
tableSum returns the ISO checksum of table t.
func tableSum(t *Table) uint64
func update(crc uint64, tab *Table, p []byte) uint64
Generated with Arrow