(PCC)::[How-SHA1-Hashes-used-to-compute-short-identities-for-binary-or-text-blobs-in-go-language]::[go]
package main import ( "crypto/sha1" "fmt" ) func main() { s := "sha1 this string" h := sha1.New() h.Write([]byte(s)) bs := h.Sum(nil) fmt.Println(s) fmt.Printf("%x\n", bs) }