Standard library / hash/crc64

hash/crc64.Update()

Extend an existing checksum with another chunk, using the same table as the earlier calculation. Starting at zero yields the ordinary checksum. This is not a cryptographic authentication primitive. Expected stdout: '995dc9bbdf1939fa\n'.

Formal Syntax & Structure

go syntaxgo
func Update(crc uint64, tab *Table, p []byte) uint64

Parameters & Attributes

NameTypeDescription
crcuint64Previously computed checksum; use zero to begin.
tab*TableRead-only lookup table for the chosen polynomial.
p[]byteAdditional input bytes.

Return Value

uint64

64-bit unsigned result.

Working Example

Example Snippetgo
package main
import (  "fmt"  "hash/crc64")
func main() {  t := crc64.MakeTable(crc64.ECMA)  v := crc64.Update(0, t, []byte("1234"))  v = crc64.Update(v, t, []byte("56789"))  fmt.Printf("%016x\n", v)}
Go Reference