Files
elect/mac.go
2023-05-31 22:40:48 -07:00

15 lines
216 B
Go

package elect
import (
"crypto/hmac"
"crypto/sha256"
"fmt"
)
func mac(payload, signingKey []byte) string {
gen := hmac.New(sha256.New, signingKey)
gen.Write(payload)
return fmt.Sprintf("%x", gen.Sum(nil))
}