rand

package
v1.7.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2020 License: MPL-2.0 Imports: 7 Imported by: 2

Documentation

Overview

Package rand implements functions similar to math/rand in the standard library, but on top of a secure random number generator.

Index

Constants

This section is empty.

Variables

Reader is the standard crypto/rand.Reader, re-exported for convenience

Functions

func Int63

func Int63() int64

Int63 returns a strongly random int63.

func Int64

func Int64() int64

Int64 returns a strongly random int64.

func Intn

func Intn(n int) int

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

func Shuffle added in v1.2.0

func Shuffle(slice interface{})

Shuffle the order of elements in slice.

func String

func String(l int) string

String returns a strongly random string of characters (taken from randomCharset) of the specified length. The returned string contains ~5.8 bits of entropy per character, due to the character set used.

Types

This section is empty.

Jump to

Keyboard shortcuts

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