Skip to content
MinatoAkaPublic

About

Lightweight Go library for HMAC-SHA256/512 and sorted query strings.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

Repository files navigation

hmacgo

Go Reference License: MIT Support via Saweria

A lightweight Go library for HMAC-SHA256/512 signatures and sorted URL query strings. Uses only the Go standard library.

Install

go get github.com/MinatoAka/hmacgo

Example

params := map[string]string{
    "symbol": "ethidr",
    "side":   "buy",
}

payload := hmacgo.BuildQuery(params) // side=buy&symbol=ethidr
signature := hmacgo.SignSHA256(payload, "your-secret")

Use SignSHA512(payload, secret) for HMAC-SHA512. BuildQuery sorts keys, URL-encodes values, and omits empty values.

Test

go test ./...

About

Lightweight Go library for HMAC-SHA256/512 and sorted query strings.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages