Golang hash/crc32.Checksum function and Table type example
package hash/crc32
Checksum returns the CRC-32 checksum of data using the polynomial represented by the Table.
Golang hash/crc32.Checksum function and Table 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)
}
Output :
Checksum : 92c80a31
References :
Advertisement
Something interesting
Tutorials
+33.8k Golang : convert(cast) bytes to string
+5.9k Unix/Linux : How to open tar.gz file ?
+13.3k Golang : Date and Time formatting
+11.9k Golang : Convert decimal number(integer) to IPv4 address
+7.4k Golang : How to detect if a sentence ends with a punctuation?
+7.6k Javascript : Push notifications to browser with Push.js
+8.2k Golang : Find relative luminance or color brightness
+9.2k Golang : How to find out similarity between two strings with Jaro-Winkler Distance?
+17.4k Golang : Check if IP address is version 4 or 6
+7.1k Golang : Validate credit card example
+7.4k Golang : Convert source code to assembly language
+11.5k Golang : Handle API query by curl with Gorilla Queries example