This commit is contained in:
@@ -2,7 +2,6 @@ package chat
|
||||
|
||||
import (
|
||||
"crypto/hmac"
|
||||
"crypto/rand"
|
||||
"crypto/sha256"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
@@ -24,14 +23,6 @@ type cursorCodec struct {
|
||||
secret [32]byte
|
||||
}
|
||||
|
||||
func newCursorCodec() cursorCodec {
|
||||
var codec cursorCodec
|
||||
if _, err := rand.Read(codec.secret[:]); err != nil {
|
||||
panic("cannot initialize cursor signing key: " + err.Error())
|
||||
}
|
||||
return codec
|
||||
}
|
||||
|
||||
func (c cursorCodec) encode(scope, owner string, createdAt time.Time, id string) string {
|
||||
payload, err := json.Marshal(cursorPayload{
|
||||
Scope: scope,
|
||||
|
||||
Reference in New Issue
Block a user