Skip to content

Instantly share code, notes, and snippets.

Created December 1, 2020 02:34
What would you like to do?
package main
import (
func main() {
handle := "@someone"
secret := "secret" // belonging to handle
tweet := "tweeted a cat"
h := hmac.New(sha256.New, []byte(secret))
sign := hex.EncodeToString(h.Sum(nil))
sep := "---------------------------------------"
fmt.Printf("%s\n%s \n%s \n{sign=%s}\n%s\n", sep, handle, tweet, sign[0:10], sep)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment