Skip to content

Latest commit

 

History

History
37 lines (26 loc) · 595 Bytes

README.md

File metadata and controls

37 lines (26 loc) · 595 Bytes

Hmacutil

Small HMAC utilities for Golang

Download

go get github.com/zpmep/hmacutil

Features

  • Computes HMAC using secret key
  • Hex string encoded
  • Base64 encoded
  • Algorithm supports:
    • MD5
    • SHA1
    • SHA256
    • SHA512

Examples

// Computes HMAC
mac := hmacutil.Encode(hmacutil.SHA256, "secret_key", "data")

// Computes HMAC in hex string encoded
mac := hmacutil.HexStringEncode(hmacutil.SHA256, "secret_key", "data")

// Computes HMAC in base64 encoded
mac := hmacutil.Base64Encode(hmacutil.SHA256, "secret_key", "data")

License

MIT