Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 17 lines (14 sloc) 0.331 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
package rev

import (
"crypto/hmac"
"crypto/sha1"
"encoding/hex"
"io"
)

// Sign a given string with the app-configured secret key.
// Return the signature in base64 (URLEncoding).
func Sign(message string) string {
mac := hmac.New(sha1.New, secretKey)
io.WriteString(mac, message)
return hex.EncodeToString(mac.Sum(nil))
}
Something went wrong with that request. Please try again.