Golang hash/crc32.NewIEEE function example
package hash/crc32
NewIEEE creates a new hash.Hash32 computing the CRC-32 checksum using the IEEE polynomial.
Golang hash/crc32.NewIEEE function usage example
package main
import (
"fmt"
"hash/crc32"
"io"
)
func main() {
crcIEEE := crc32.NewIEEE()
crcIEEE.Write([]byte("abcd"))
fmt.Printf("Sum32 : %x \n", crcIEEE.Sum32())
crcIEEE.Reset()
io.WriteString(crcIEEE, "defg") // alternative way to write
fmt.Printf("Sum32 after reset : %x \n", crcIEEE.Sum32())
}
Output :
Sum32 : ed82cd11
Sum32 after reset : 3b6d8e59
References :
Advertisement
Something interesting
Tutorials
+9.1k Golang : Handle sub domain with Gin
+80.6k Golang : How to return HTTP status code?
+5.4k Golang *File points to a file or directory ?
+12.1k Golang : Save webcamera frames to video file
+8.2k Golang : Add build version and other information in executables
+22.2k Golang : Securing password with salt
+10.3k Golang : How to check if a website is served via HTTPS
+18.5k Golang : Example for RSA package functions
+5.3k Golang : Get FX sentiment from website example
+5.7k Fix yum-complete-transaction error
+11.3k Golang : Characters limiter example