(n int)
| 14 | const letterBytes = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" |
| 15 | |
| 16 | func String(n int) string { |
| 17 | b := make([]byte, n) |
| 18 | letterLen := big.NewInt(int64(len(letterBytes))) |
| 19 | for i := range b { |
| 20 | idx, err := rand.Int(rand.Reader, letterLen) |
| 21 | if err != nil { |
| 22 | panic(err) |
| 23 | } |
| 24 | b[i] = letterBytes[idx.Int64()] |
| 25 | } |
| 26 | return string(b) |
| 27 | } |
| 28 | |
| 29 | func Token() string { |
| 30 | return "openlist-" + uuid.NewString() + String(64) |
no outgoing calls
no test coverage detected