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 ?
The docs pa
Here's some good examples:
The second example targets sha256, to do sha1 hexadecimal you'd do:
// Calculate the hexadecimal HMAC SHA1 of requestDate using sKey
key := []byte(c.SKey)
h := hmac.New(sha1.New, key)
h.Write([]byte(requestDate))
hmacString := hex.EncodeToString(h.Sum(nil))
(from https://github.com/soniah/dnsmadeeasy)