shortID produces a " unique" 6 bytes long string. Do not use as a reliable way to get unique IDs, instead use for things like logging.
()
| 128 | // shortID produces a " unique" 6 bytes long string. |
| 129 | // Do not use as a reliable way to get unique IDs, instead use for things like logging. |
| 130 | func shortID() string { |
| 131 | b := make([]byte, 6) |
| 132 | io.ReadFull(rand.Reader, b) // nolint: errcheck |
| 133 | return base64.RawURLEncoding.EncodeToString(b) |
| 134 | } |