A lightweight Go library for HMAC-SHA256/512 signatures and sorted URL query strings. Uses only the Go standard library.
go get github.com/MinatoAka/hmacgoparams := 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.
go test ./...