gobyexample/sha/sha.go

14 lines
180 B
Go
Raw Permalink Normal View History

2024-05-02 18:35:14 +00:00
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))
}