crc32
少于1分钟
crc32
https://pkg.go.dev/hash/crc32@go1.20.1
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.
常量
| |
Predefined polynomials.
| |
The size of a CRC-32 checksum in bytes.
变量
| |
IEEETable is the table for the IEEE polynomial.
函数
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 New
| |
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.
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.
func Update
| |
Update returns the result of adding the bytes in p to the crc.
类型
type Table
| |
Table is a 256-word table representing the polynomial for efficient processing.
func MakeTable
| |
MakeTable returns a Table constructed from the specified polynomial. The contents of this Table must not be modified.