Standard library / hash/crc32

hash/crc32.Checksum()

Compute a complete checksum with the selected table. Both sides must agree on CRC parameters and byte sequence. This is not a cryptographic authentication primitive. Expected stdout: 'cbf43926\n'.

Formal Syntax & Structure

go syntaxgo
func Checksum(data []byte, tab *Table) uint32

Parameters & Attributes

NameTypeDescription
data[]byteBytes whose checksum is computed.
tab*TableRead-only lookup table for the chosen polynomial.

Return Value

uint32

32-bit unsigned checksum.

Working Example

Example Snippetgo
package main
import (  "fmt"  "hash/crc32")
func main() { fmt.Printf("%08x\n", crc32.Checksum([]byte("123456789"), crc32.MakeTable(crc32.IEEE))) }
Go Reference