xrand

package
v2.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2023 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	LetterSeed           = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" // 字母字
	LetterLowerSeed      = "abcdefghijklmnopqrstuvwxyz"                           // 小写字母
	LetterUpperSeed      = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"                           // 大写字母
	DigitSeed            = "0123456789"                                           // 数字
	DigitWithoutZeroSeed = "123456789"                                            // 无0数字
	SymbolSeed           = "!\\\"#$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~"               // 特殊字符
)

Variables

This section is empty.

Functions

func Digits

func Digits(length int) string

Digits 生成指定长度的数字字符串

func Float32

func Float32(min, max float32) float32

Float32 生成[min,max)范围间的32位浮点数

func Float64

func Float64(min, max float64) float64

Float64 生成[min,max)范围间的64位浮点数

func Int

func Int(min, max int) int

Int 生成[min,max]的整数 min -50 max 100

func Int32

func Int32(min, max int32) int32

Int32 生成[min,max]范围间的32位整数,

func Int64

func Int64(min, max int64) int64

Int64 生成[min,max]范围间的64位整数

func Letters

func Letters(length int) string

Letters 生成指定长度的字母字符串

func Lucky

func Lucky(probability float64, base ...float64) bool

Lucky 根据概率抽取幸运值

func Str

func Str(seed string, length int) (str string)

Str 生成指定长度的字符串

func Symbols

func Symbols(length int) string

Symbols 生成指定长度的特殊字符串

func Weight

func Weight(list []interface{}, fn func(v interface{}) float64) int

Weight 权重随机

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL