Can someone show me a working example of how to generate a SHA hash of a string that I have, say myPassword := \"beautiful\" , using Go 1 ?
myPassword := \"beautiful\"
The docs pa
h := sha1.New() h.Write(content) sha := h.Sum(nil) // "sha" is uint8 type, encoded in base16 shaStr := hex.EncodeToString(sha) // String representation fmt.Printf("%x\n", sha) fmt.Println(shaStr)