GenerateID generates the "id" part of the token.
(_ context.Context)
| 110 | |
| 111 | // GenerateID generates the "id" part of the token. |
| 112 | func 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. |
| 122 | func GenerateKey(_ context.Context) (string, error) { |
no test coverage detected