Documentation ¶
Index ¶
- func B(n int) []byte
- func D(min, max time.Duration) time.Duration
- func Digits(n int) string
- func GenerateRuleName() string
- func GenerateUUID20() string
- func GenerateUUID32() string
- func GooGleUUID() string
- func GoogleUUID20() string
- func GoogleUUID32() string
- func Intn(max int) int
- func LS(n int) string
- func Letters(n int) string
- func Meet(num, total int) bool
- func MeetProb(prob float32) bool
- func N(min, max int) int
- func Perm(n int) []int
- func S(n int, symbols ...bool) string
- func Str(s string, n int) string
- func Symbols(n int) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateRuleName ¶
func GenerateRuleName() string
func GenerateUUID20 ¶
func GenerateUUID20() string
GenerateUUID20 @description: 20位uuid @param: @author: GJing @email: gjing1st@gmail.com @date: 2022/4/6 11:39 @success:
func GenerateUUID32 ¶
func GenerateUUID32() string
GenerateUUID32 @description: 生成uid 32位 @param: @author: GJing @email: gjing1st@gmail.com @date: 2022/4/6 11:37 @success:
func GooGleUUID ¶
func GooGleUUID() string
func GoogleUUID20 ¶
func GoogleUUID20() string
GoogleUUID20 @description: 20位uuid @param: @author: GJing @email: gjing1st@gmail.com @date: 2022/4/6 13:11 @success:
func GoogleUUID32 ¶
func GoogleUUID32() string
GoogleUUID32 @description: google/uuid @param: @author: GJing @email: gjing1st@gmail.com @date: 2022/4/6 13:08 @success:
func Intn ¶
Intn returns a int number which is between 0 and max: [0, max).
Note that: 1. The `max` can only be greater than 0, or else it returns `max` directly; 2. The result is greater than or equal to 0, but less than `max`; 3. The result number is 32bit and less than math.MaxUint32.
func N ¶
N returns a random int between min and max: [min, max]. The `min` and `max` also support negative numbers.
func Perm ¶
Perm returns, as a slice of n int numbers, a pseudo-random permutation of the integers [0,n). TODO performance improving for large slice producing.
func S ¶
S returns a random string which contains digits and letters, and its length is `n`. The optional parameter `symbols` specifies whether the result could contain symbols, which is false in default.
Types ¶
This section is empty.