crc

package
v0.0.0-...-5e8aad0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChecksumIEEE

func ChecksumIEEE(data []byte) uint32

ChecksumIEEE returns the CRC-32 checksum of the given data. The algorithm is the one expected by Cassandra: the actual checksum is computed over the combination of 4 fixed initial bytes and the given byte slice.

func ChecksumKoopman

func ChecksumKoopman(data uint64, len int) uint32

ChecksumKoopman returns the CRC-24 checksum of the given data. The parameter bytes is an up to 8-byte register containing bytes to compute the CRC over; bits will be read least-significant to most significant. The parameter len is the number of bytes, greater than 0 and fewer than 9, to be read from bytes. The polynomial is chosen from https://users.ece.cmu.edu/~koopman/crc/index.html, by Philip Koopman, and is licensed under the Creative Commons Attribution 4.0 International License (https://creativecommons.org/licenses/by/4.0). Koopman's own notation to represent the polynomial has been changed. This polynomial provides hamming distance of 8 for messages up to length 105 bits; we only support 8-64 bits at present, with an expected range of 40-48.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL