Created
September 12, 2016 07:32
-
-
Save byrnedo/46489dae775a22e71818950a6a5c9a68 to your computer and use it in GitHub Desktop.
Compute a hmac for a message in golang
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func ComputeHmac256(message string, secret string) string { | |
key := []byte(secret) | |
h := hmac.New(sha256.New, key) | |
h.Write([]byte(message)) | |
return base64.StdEncoding.EncodeToString(h.Sum(nil)) | |
} |
π
π
π
π
Thank you!
thankyouu
π
βπΏ
π
π
π
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
π