newRandomStringN creates a new random string of length n.
(n int)
| 48 | |
| 49 | // newRandomStringN creates a new random string of length n. |
| 50 | func newRandomStringN(n int) string { |
| 51 | randBytes := make([]byte, n/2) |
| 52 | _, _ = rand.Read(randBytes) |
| 53 | |
| 54 | return fmt.Sprintf("%x", randBytes) |
| 55 | } |