Golang hash/adler32.New function example

package hash/adler32

New returns a new hash.Hash32 computing the Adler-32 checksum.

Golang hash/adler32.New function usage example

 package main

 import (
 "fmt"
 "hash/adler32"
 )

 func main() {

 hasher := adler32.New()
 hasher.Write([]byte("abcd")) 

 fmt.Println(hasher.Sum32())

 }

Reference :

http://golang.org/pkg/hash/adler32/#New

Advertisement