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) uint64Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| crc | uint64 | Previously computed checksum; use zero to begin. |
| tab | *Table | Read-only lookup table for the chosen polynomial. |
| p | []byte | Additional 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)}