Golang hash/crc32.Update function example
package hash/crc32
Update returns the result of adding the bytes in p to the crc.
Golang hash/crc32.Update function usage example
package main
import (
"fmt"
"hash/crc32"
)
var crcTable *crc32.Table
func main() {
checksum := crc32.Checksum([]byte("abcd"), crcTable)
fmt.Printf("Checksum : %x \n", checksum)
updatedchecksum := crc32.Update(checksum, crcTable, []byte("defg"))
fmt.Printf("Updated Checksum : %x \n", updatedchecksum)
}
Output :
Checksum : 92c80a31
Updated Checksum : 704eef2f
References :
http://golang.org/pkg/hash/crc32/#Update
https://www.socketloop.com/references/golang-hash-crc32-checksum-function-and-table-type-example
Advertisement
Something interesting
Tutorials
+11.9k Golang : Convert decimal number(integer) to IPv4 address
+9.7k PHP : Get coordinates latitude/longitude from string
+12k Golang : Convert a rune to unicode style string \u
+9k Golang : How to use Gorilla webtoolkit context package properly
+28.7k Golang : Detect (OS) Operating System
+11.5k CodeIgniter : Import Linkedin data
+10.2k Golang : Text file editor (accept input from screen and save to file)
+6.3k Javascript : Generate random key with specific length
+7.1k Golang : Transform lisp or spinal case to Pascal case example
+4.8k PHP : Extract part of a string starting from the middle
+5.7k Fix yum-complete-transaction error
+14.2k Elastic Search : Mapping date format and sort by date