Skip to content

Commit

Permalink
Add SignatureFor uid
Browse files Browse the repository at this point in the history
  • Loading branch information
collimarco committed Dec 24, 2022
1 parent 577fd6f commit 5999241
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions signature.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package pushpad

import (
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
)

func SignatureFor(uid string) string {
h := hmac.New(sha256.New, []byte(pushpadAuthToken))
h.Write([]byte(uid))
return hex.EncodeToString(h.Sum(nil))
}

0 comments on commit 5999241

Please sign in to comment.