MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / GenerateKey

Function GenerateKey

pkg/auth/auth.go:122–129  ·  view source on GitHub ↗

GenerateKey generates the "key" part of the token.

(_ context.Context)

Source from the content-addressed store, hash-verified

120
121// GenerateKey generates the "key" part of the token.
122func GenerateKey(_ context.Context) (string, error) {
123 var b [keyLength]byte
124 _, err := rand.Read(b[:])
125 if err != nil {
126 return "", err
127 }
128 return enc.EncodeToString(b[:]), nil
129}

Callers 10

sendInvitationMethod · 0.92
createClientMethod · 0.92
createLoginTokenMethod · 0.92
NewUserSessionMethod · 0.92
CreateUserSessionMethod · 0.92
GenerateMethod · 0.85

Calls 1

ReadMethod · 0.45

Tested by

no test coverage detected