package crc32
Import Path
hash/crc32 (on golang.org and go.dev)
Dependency Relation
imports 5 packages, and imported by one package
Involved Source Files
Package crc32 implements the 32-bit cyclic redundancy check, or CRC-32,
checksum. See https://en.wikipedia.org/wiki/Cyclic_redundancy_check for
information.
Polynomials are represented in LSB-first form also known as reversed representation.
See https://en.wikipedia.org/wiki/Mathematics_of_cyclic_redundancy_checks#Reversed_representations_and_reciprocal_polynomials
for information.
crc32_arm64.go
crc32_generic.go
crc32_arm64.s
Package-Level Type Names (total 3, in which 1 are exported)
Table is a 256-word table representing the polynomial for efficient processing.
func MakeTable(poly uint32) *Table
func simpleMakeTable(poly uint32) *Table
func Checksum(data []byte, tab *Table) uint32
func New(tab *Table) hash.Hash32
func Update(crc uint32, tab *Table, p []byte) uint32
func simplePopulateTable(poly uint32, t *Table)
func simpleUpdate(crc uint32, tab *Table, p []byte) uint32
func tableSum(t *Table) uint32
var IEEETable *Table
var castagnoliTable *Table
Package-Level Functions (total 24, in which 6 are exported)
Checksum returns the CRC-32 checksum of data
using the polynomial represented by the Table.
ChecksumIEEE returns the CRC-32 checksum of data
using the IEEE polynomial.
MakeTable returns a Table constructed from the specified polynomial.
The contents of this Table must not be modified.
New creates a new hash.Hash32 computing the CRC-32 checksum using the
polynomial represented by the Table. Its Sum method will lay the
value out in big-endian byte order. The returned Hash32 also
implements encoding.BinaryMarshaler and encoding.BinaryUnmarshaler to
marshal and unmarshal the internal state of the hash.
NewIEEE creates a new hash.Hash32 computing the CRC-32 checksum using
the IEEE polynomial. Its Sum method will lay the value out in
big-endian byte order. The returned Hash32 also implements
encoding.BinaryMarshaler and encoding.BinaryUnmarshaler to marshal
and unmarshal the internal state of the hash.
Update returns the result of adding the bytes in p to the crc.
Package-Level Variables (total 11, in which 1 are exported)
IEEETable is the table for the IEEE polynomial.
Package-Level Constants (total 7, in which 4 are exported)
Castagnoli's polynomial, used in iSCSI.
Has better error detection characteristics than IEEE.
https://dx.doi.org/10.1109/26.231911
IEEE is by far and away the most common CRC-32 polynomial.
Used by ethernet (IEEE 802.3), v.42, fddi, gzip, zip, png, ...
Koopman's polynomial.
Also has better error detection characteristics than IEEE.
https://dx.doi.org/10.1109/DSN.2002.1028931
The size of a CRC-32 checksum in bytes.
The pages are generated with Golds v0.2.8-preview. (GOOS=darwin GOARCH=arm64)