Golang hash/crc64.New and MakeTable functions example
package hash/crc64
New creates a new hash.Hash64 computing the CRC-64 checksum using the polynomial represented by the Table.
Golang hash/crc64.New and MakeTable functions usage example
package main
import (
"fmt"
"hash/crc64"
)
var ECMATable = crc64.MakeTable(crc64.ECMA)
func main() {
hasher := crc64.New(ECMATable)
hasher.Reset()
hasher.Write([]byte("abcd"))
fmt.Printf("Hash64 value : %x\n", hasher.Sum64())
}
Output :
Hash64 value : 3c9d28596e5960ba
Reference :
Advertisement
Something interesting
Tutorials
+32.1k Golang : Validate email address with regular expression
+13.4k Golang : Generate Code128 barcode
+9.5k Golang : Get all countries currencies code in JSON format
+9.5k Golang : Accessing content anonymously with Tor
+5.2k Responsive Google Adsense
+10.2k Golang : How to profile or log time spend on execution?
+4.1k Javascript : Empty an array example
+9.2k Golang : Create and shuffle deck of cards example
+62.7k Golang : Convert HTTP Response body to string
+9.7k Golang : Find correlation coefficient example
+15.2k Golang : How to check if IP address is in range
+36.5k Golang : Validate IP address