Int63n returns a random number in the range [0,n).
(n int64)
| 24 | |
| 25 | // Int63n returns a random number in the range [0,n). |
| 26 | func Int63n(n int64) int64 { |
| 27 | i, err := rand.Int(rand.Reader, big.NewInt(int64(n))) |
| 28 | if err != nil { |
| 29 | panic(err) |
| 30 | } |
| 31 | return i.Int64() |
| 32 | } |
| 33 | |
| 34 | // Bytes generates a random byte slice of length n. |
| 35 | func Bytes(n int) []byte { |
no outgoing calls