random

package
v0.0.0-...-16d328e Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2014 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PseudoRandInt

func PseudoRandInt(max int) (int, error)

Returns non crypto grade random int [0, max]. If max == 10 -> returns value between 0 and 9.

func RandInt

func RandInt(max int64) (int64, error)

Returns a crypto grade random value [0, max]. If max == 10 -> returns value between 0 and 9. Because of the crypto grade it's quite slow so don't use if crypto grade is not an requirement and speed is important.

func RandIntMinMax

func RandIntMinMax(min int64, max int64) (r64 int64, err error)

Returns a crypto grade random value [min, max]. If min == 5 && max == 10 -> returns value between 5 and 9. Because of the crypto grade it's quite slow so don't use if crypto grade is not an requirement and speed is important.

func RandString

func RandString(n int) (string, error)

Returns a crypto grade string of len(n). Because of the crypto grade it's quite slow so don't use if crypto grade is not an requirement and speed is important.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳