// makeHmac: // non-exportable helper to do SHA256 HMAC func makeHmac(data string, key string) string { byteKey, _ := hex.DecodeString(key) byteData := []byte(data) sig := hmac.New(sha256.New, byteKey) sig.Write([]byte(byteData)) return base64.StdEncoding.EncodeToString(sig.Sum(nil)) }