package
Version:
v1.0.1
Opens a new window with list of versions in this module.
Published: May 31, 2021
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package grand provides high performance random string generation functionality.
Digits returns a random string which contains only digits, and its length is <n>.
Intn returns a int number which is between 0 and max - [0, max).
Note:
1. The result is greater than or equal to 0, but less than <max>;
2. The result number is 32bit and less than math.MaxUint32.
Letters returns a random string which contains only letters, and its length is <n>.
Meet randomly calculate whether the given probability <num>/<total> is met.
MeetProb randomly calculate whether the given probability is met.
N returns a random int between min and max - [min, max].
The <min> and <max> also support negative numbers.
Perm returns, as a slice of n int numbers, a pseudo-random permutation of the integers [0,n).
Str returns a random string which contains digits and letters, and its length is <n>.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.