Documentation ¶
Index ¶
Constants ¶
View Source
const ( // IEEE is by far and away the most common CRC-32 polynomial. // Used by ethernet (IEEE 802.3), v.42, fddi, gzip, zip, png, ... IEEE = 0xedb88320 // Castagnoli's polynomial, used in iSCSI. // Has better error detection characteristics than IEEE. // https://dx.doi.org/10.1109/26.231911 Castagnoli = 0x82f63b78 // Koopman's polynomial. // Also has better error detection characteristics than IEEE. // https://dx.doi.org/10.1109/DSN.2002.1028931 Koopman = 0xeb31d82e )
Predefined polynomials.
View Source
const Size = 4
The size of a CRC-32 checksum in bytes.
Variables ¶
This section is empty.
Functions ¶
func Checksum ¶
Checksum returns the CRC-32 checksum of data using the polynomial represented by the Table.
func ChecksumIEEE ¶
ChecksumIEEE returns the CRC-32 checksum of data using the IEEE polynomial.
func NewIEEE ¶
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.
Types ¶
Click to show internal directories.
Click to hide internal directories.