Documentation ¶
Index ¶
- func Base62(s int) string
- func Base64(n int) string
- func Bytes(n int) []byte
- func Hex(n int) string
- func Perm(n uint32) []uint32
- func Probability(prob uint32) bool
- func Random(ss []string) []string
- func Read(b []byte)
- func Sampling(rate uint8) bool
- func Shuffle(n int, swap func(i, j int))
- func String(n int, letters ...string) string
- func Uint32() uint32
- func Uint32n(maxN uint32) uint32
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Probability ¶
Probability 小于prob的概率, prob is in the range [0,1000)
func Read ¶
func Read(b []byte)
Read is a helper function that calls rr.Read on b. It always fills b completely.
func Shuffle ¶
Shuffle pseudo-randomizes the order of elements.
n: is the number of elements. Shuffle panics if n < 0. swap: swaps the elements with indexes i and j.
func String ¶
String generates a random string using only letters provided in the letters parameter if user commit letters parameters, this function will use defLetters instead
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.