Standard library / hash/crc32
hash/crc32.MakeTable()
Build or obtain a lookup table for a reversed polynomial. Do not mutate the returned table; reuse it for matching checksum calculations. This is not a cryptographic authentication primitive. Expected stdout: 'cbf43926\n'.
Formal Syntax & Structure
go syntaxgo
func MakeTable(poly uint32) *TableParameters & Attributes
| Name | Type | Description |
|---|---|---|
| poly | uint32 | Polynomial in reversed, least-significant-bit-first form. |
Return Value
*Table
Lookup table; do not modify it.
Working Example
Example Snippetgo
package main
import ( "fmt" "hash/crc32")
func main() { t := crc32.MakeTable(crc32.IEEE) fmt.Printf("%08x\n", crc32.Checksum([]byte("123456789"), t))}