MCPcopy Create free account
hub / github.com/SenseUnit/dumbproxy / CalculateHMACSignature

Function CalculateHMACSignature

auth/hmac.go:149–155  ·  view source on GitHub ↗
(secret []byte, username string, expire int64)

Source from the content-addressed store, hash-verified

147}
148
149func CalculateHMACSignature(secret []byte, username string, expire int64) []byte {
150 mac := hmac.New(sha256.New, secret)
151 mac.Write([]byte(HMACSignaturePrefix))
152 mac.Write([]byte(username))
153 binary.Write(mac, binary.BigEndian, expire)
154 return mac.Sum(nil)
155}

Callers 4

hmacSignFunction · 0.92

Calls 1

WriteMethod · 0.45