gobyexample/sha/sha.go

14 lines
180 B
Go

package sha
import (
"crypto/sha256"
"fmt"
)
func Sha() {
h := sha256.New()
h.Write([]byte("hello world!"))
fmt.Printf("SHA256 hash of 'hello world!': %x\n", h.Sum(nil))
}