Fix HMAC calculation
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
nemunaire 2022-02-19 15:30:26 +01:00
parent 173964a6fc
commit 21ef2f1372
5 changed files with 20 additions and 6 deletions

View file

@ -15,5 +15,8 @@ func main() {
sharedSecret = os.Args[1]
}
fmt.Println(base64.StdEncoding.EncodeToString(hmac.New(sha512.New, []byte(sharedSecret)).Sum([]byte(fmt.Sprintf("%d", time.Now().Unix()/10)))))
h := hmac.New(sha512.New, []byte(sharedSecret))
h.Write([]byte(fmt.Sprintf("%d", time.Now().Unix()/10)))
fmt.Println(base64.StdEncoding.EncodeToString(h.Sum(nil)))
}