grand

package
v1.4.7 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 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 added in v1.4.6

func Digits(n int) string

RandDigits 别名

func Letters added in v1.4.6

func Letters(n int) string

RandLetters 别名

func Meet added in v1.4.6

func Meet(num, total int) bool

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

func MeetProb added in v1.4.6

func MeetProb(prob float32) bool

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

func N added in v1.4.6

func N(min, max int) int

Rand 别名

func Rand

func Rand(min, max int) int

获得一个 min, max 之间的随机数(min <= x <= max)

func RandDigits

func RandDigits(n int) string

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

func RandLetters

func RandLetters(n int) string

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

func RandStr

func RandStr(n int) string

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

func Str added in v1.4.6

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