package encode import ( "crypto/hmac" "crypto/sha512" "encoding/hex" ) func CalcDevHexedSign(modelId, devID, date string, hmacKey string) string { mac := hmac.New(sha512.New, []byte(hmacKey)) mac.Write([]byte(modelId + devID + date)) return hex.EncodeToString(mac.Sum(nil)) }