Documentation ¶
Index ¶
- Constants
- Variables
- func Gen6Number() string
- func Generate(l int, dict string) (string, error)
- func GetBase32String(num int) string
- func GetRandomItNum(num int) int
- func GetRandomNumber(num int) string
- func GetRandomString(num int) string
- func RedPackage(count int, money int64) []int64
- func Shuffle(arr []int64)
Constants ¶
View Source
const ( // CharsNum contains numbers from 0-9 CharsNum = "0123456789" // CharsAlpha contains the full English alphabet: letters a-z and A-Z CharsAlpha = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" // CharsAlphaNum is a combination of CharsNum and CharsAlpha CharsAlphaNum = CharsNum + CharsAlpha // CharsASCII contains all printable ASCII characters in code range [32, 126] CharsASCII = CharsAlphaNum + " !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~" )
Variables ¶
View Source
var ( // ErrInvalidLengthSpecified is returned when the length specified is invalid ErrInvalidLengthSpecified = errors.New("invalid password length specified") // ErrInvalidDictSpecified is returned when the dictionary specified is invalid ErrInvalidDictSpecified = errors.New("invalid password dictionary specified") )
Functions ¶
func Generate ¶
Generate generates a cryptographically secure and unbiased string of length 'l' using alphabet 'dict'
func GetRandomItNum ¶
GetRandomItNum 返回输入参数以下的随机数字,如输入参数为5,随机返回1,2,3,4,5
func RedPackage ¶
RedPackage 发红包 count: 红包数量 money: 红包金额(单位:分)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.