grand

package
v1.5.7 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package grand provides high performance API for random functionality.

随机数管理.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Digits

func Digits(n int) string

RandDigits 别名

func Intn

func Intn(max int) int

自定义的 rand.Intn ,绝对随机, 返回: [0, max)

func Letters

func Letters(n int) string

RandLetters 别名

func Meet

func Meet(num, total int) bool

随机计算是否满足给定的概率(分子/分母)

func MeetProb

func MeetProb(prob float32) bool

随机计算是否满足给定的概率(float32)

func N

func N(min, max int) int

Rand 别名, 返回: [min, max]

func Perm

func Perm(n int) []int

Perm returns, as a slice of n ints, a pseudo-random permutation of the integers [0,n).

func Rand

func Rand(min, max int) int

获得一个 min, max 之间的随机数: [min, max]

func RandDigits

func RandDigits(n int) string

获得指定长度的随机数字字符串

func RandLetters

func RandLetters(n int) string

获得指定长度的随机字母字符串

func RandStr

func RandStr(n int) string

获得指定长度的随机字符串(可能包含数字和字母)

func Str

func Str(n int) string

RandStr 别名

Types

This section is empty.

Jump to

Keyboard shortcuts

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