extrand

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2021 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Overview

Package extrand extend rand

Index

Constants

This section is empty.

Variables

View Source
var Digital = []byte("0123456789")
View Source
var DigitalLetter = []byte("QWERTYUIOPLKJHGFDSAZXCVBNMabcdefghijklmnopqrstuvwxyz0123456789")
View Source
var Letter = []byte("QWERTYUIOPLKJHGFDSAZXCVBNMabcdefghijklmnopqrstuvwxyz")
View Source
var Symbol = []byte("QWERTYUIOPLKJHGFDSAZXCVBNMabcdefghijklmnopqrstuvwxyz0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_{|}~`")

Functions

func Float32 added in v0.2.3

func Float32() float32

Float32 returns, as a float32, a pseudo-random number in [0.0,1.0).

func Float64

func Float64() float64

Float64 returns, as a float64, a pseudo-random number in [0.0,1.0).

func Float64x added in v0.2.3

func Float64x(min, max float64) float64

Float64 随机min,max中的值

func Int

func Int() int

Int returns a non-negative pseudo-random int.

func Int31

func Int31() int32

Int31 returns a non-negative pseudo-random 31-bit integer as an int32.

func Int31n added in v0.2.3

func Int31n(n int32) int32

Int31n returns, as an int32, a non-negative pseudo-random number in [0,n). It panics if n <= 0.

func Int31x added in v0.2.3

func Int31x(min, max int32) int32

Int31 随机[min,max)中的值

func Int63

func Int63() int64

Int63 returns a non-negative pseudo-random 63-bit integer as an int64.

func Int63n added in v0.2.3

func Int63n(n int64) int64

Int63n returns, as an int64, a non-negative pseudo-random number in [0,n). It panics if n <= 0.

func Int63x added in v0.2.3

func Int63x(min, max int64) int64

Int63 随机[min,max)中的值

func Intn added in v0.2.3

func Intn(n int) int

Intn returns, as an int, a non-negative pseudo-random number in [0,n). It panics if n <= 0.

func Intx added in v0.2.3

func Intx(min, max int) int

Int 随机[min,max)中的值

func Perm added in v0.2.3

func Perm(n int) []int

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

func Rand added in v0.2.2

func Rand(length int, alphabets ...byte) string

Rand rand bytes(如果没有给出alphabets,将使用DigitalLetter)

func RandBytes added in v0.2.2

func RandBytes(length int, alphabets ...byte) []byte

RandBytes rand bytes(如果没有给出alphabets,将使用DigitalLetter)

func RandLetter

func RandLetter(length int) string

RandLetter rand alpha with give length(只包含字母)

func RandLetterBytes added in v0.2.2

func RandLetterBytes(length int) []byte

RandLetterBytes rand alpha with give length(只包含字母)

func RandNumeric added in v0.2.2

func RandNumeric(length int) string

RandNumeric rand string with give length(包含数字)

func RandNumericBytes added in v0.2.2

func RandNumericBytes(length int) []byte

RandNumericBytes rand string with give length(包含数字)

func RandString

func RandString(length int) string

RandString rand string with give length(包含字母, 数字)

func RandStringBytes added in v0.2.2

func RandStringBytes(length int) []byte

RandStringBytes rand string with give length(包含字母, 数字)

func RandSymbol

func RandSymbol(length int) string

RandSymbol rand symbol with give length(包含字母, 数字, 特殊符号)

func RandSymbolBytes added in v0.2.2

func RandSymbolBytes(length int) []byte

RandSymbolBytes rand symbol with give length(包含字母, 数字, 特殊符号)

func Uint32 added in v0.2.3

func Uint32() uint32

Uint32 returns a pseudo-random 32-bit value as a uint32.

func Uint64 added in v0.2.3

func Uint64() uint64

Uint64 returns a non-negative pseudo-random 64-bit integer as an uint64.

Types

This section is empty.

Jump to

Keyboard shortcuts

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