package main
import (
"crypto/sha256"
"fmt"
)
func main() {
teksti := "Lorem Ipsum dolor sit Amet"
sha_256 := sha256.New()
sha_256.Write([]byte(teksti))
fmt.Printf("Teksti:\t\t%v\n", teksti)
fmt.Printf("sha256:\t\t%x\n", sha_256.Sum(nil))
}
https://play.golang.org/p/sGbSxbLLTVS
Rezultati:
Teksti: Lorem Ipsum dolor sit Amet
sha256: eb7a03c377c28da97ae97884582e6bd07fa44724af99798b42593355e39f82cb