jackpham1510 / hmacutil

Small HMAC utilities for Golang

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hmacutil

Small HMAC utilities for Golang

Download

go get github.com/tiendung1510/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

About

Small HMAC utilities for Golang

License:MIT License


Languages

Language:Go 100.0%