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

Function GenerateID

pkg/auth/auth.go:112–119  ·  view source on GitHub ↗

GenerateID generates the "id" part of the token.

(_ context.Context)

Source from the content-addressed store, hash-verified

110
111// GenerateID generates the "id" part of the token.
112func GenerateID(_ context.Context) (string, error) {
113 var b [idLength]byte
114 _, err := rand.Read(b[:])
115 if err != nil {
116 return "", err
117 }
118 return enc.EncodeToString(b[:]), nil
119}
120
121// GenerateKey generates the "key" part of the token.
122func GenerateKey(_ context.Context) (string, error) {

Callers 4

GenerateAccessTokenMethod · 0.92
GenerateMethod · 0.85

Calls 1

ReadMethod · 0.45

Tested by

no test coverage detected