MCPcopy Create free account
hub / github.com/daodst/chat / NewSharedSecretRegistration

Function NewSharedSecretRegistration

clientapi/routing/register_secret.go:45–51  ·  view source on GitHub ↗
(sharedSecret string)

Source from the content-addressed store, hash-verified

43}
44
45func NewSharedSecretRegistration(sharedSecret string) *SharedSecretRegistration {
46 return &SharedSecretRegistration{
47 sharedSecret: sharedSecret,
48 // nonces live for 5mins, purge every 10mins
49 nonces: cache.New(5*time.Minute, 10*time.Minute),
50 }
51}
52
53func (r *SharedSecretRegistration) GenerateNonce() string {
54 nonce := util.RandomString(16)

Callers 2

TestSharedSecretRegisterFunction · 0.85
SetupFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestSharedSecretRegisterFunction · 0.68