drand

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func B added in v0.0.4

func B(n int) []byte

B 检索并返回给定长度' n '的随机字节。

func D added in v0.0.4

func D(min, max time.Duration) time.Duration

D 返回随机时间

func Digits added in v0.0.4

func Digits(n int) string

Digits 返回随机数字

func Intn

func Intn(max int) int

Intn 返回一个介于0-max之间的随机数 1. ' max '只能大于0,否则直接返回' max '; 2。结果大于等于0,但小于' max '; 3。结果数为32位,小于math.MaxUint32。

func Letters added in v0.0.4

func Letters(n int) string

Letters 返回指定长度的随机字母

func Meet added in v0.0.4

func Meet(num, total int) bool

Meet 随机对比概率

func MeetProb added in v0.0.4

func MeetProb(prob float32) bool

MeetProb 随机计算是否满足给定的概率。

func N added in v0.0.4

func N(min, max int) int

N 返回在一个[min,max]之间的随机数,支持负数

func Perm

func Perm(n int) []int

Perm 返回n数目的随机int切片

func S added in v0.0.4

func S(n int, symbols ...bool) string

S 返回长度为N的随机字符串 symbols 传入表示支持符号

func Str added in v0.0.4

func Str(s string, n int) string

Str 返回给定字符串中的随机位数

func Symbols added in v0.0.4

func Symbols(n int) string

Symbols 返回长度为n的随机符号

Types

This section is empty.

Jump to

Keyboard shortcuts

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