Skip to content

Instantly share code, notes, and snippets.

@turret-io
turret-io / verify_hmac.go
Last active October 27, 2024 01:40
Verify HMAC in Go
package main
import (
"crypto/hmac"
"crypto/sha512"
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"net/url"
@turret-io
turret-io / gen_hmac.go
Created September 24, 2014 15:28
Generate HMAC in Go
package main
import (
"crypto/hmac"
"crypto/sha512"
"encoding/base64"
"encoding/json"
"fmt"
"strconv"
"time"