Golang hash/crc64.Checksum and MakeTable functions example
package hash/crc64
Checksum returns the CRC-64 checksum of data using the polynomial represented by the Table.
MakeTable returns the Table constructed from the specified polynomial.
Golang hash/crc64.Checksum and MakeTable functions usage example
package main
import (
"fmt"
"hash/crc64"
)
func main() {
crcTable := crc64.MakeTable(crc64.ECMA) // http://golang.org/pkg/hash/crc64/#pkg-constants
checksum64 := crc64.Checksum([]byte("abcd"), crcTable)
fmt.Printf("Checksum : %x \n", checksum64)
}
Output :
Checksum : 3c9d28596e5960ba
References :
Advertisement
Something interesting
Tutorials
+5.6k Swift : Get substring with rangeOfString() function example
+10.1k Golang : Test a slice of integers for odd and even numbers
+12.1k Golang : Save webcamera frames to video file
+16.3k Golang : Loop each day of the current month example
+9.4k Facebook : Getting the friends list with PHP return JSON format
+8.2k Golang : Qt splash screen with delay example
+12.7k Golang : Sort and reverse sort a slice of bytes
+9.3k Golang : How to protect your source code from client, hosting company or hacker?
+7.5k Golang : Shuffle strings array
+5k Golang : Display packages names during compilation
+6k Golang : Convert Chinese UTF8 characters to Pin Yin
+7.9k Golang : Trim everything onward after a word