seed

package module
v0.0.0-...-e1d3770 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2017 License: MIT Imports: 6 Imported by: 0

README

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RandomKeyCharacters = []byte("abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ")

RandomKeyCharacters is a []byte of the characters to choose from when generating random keys.

View Source
var RandomKeyIntegers = []byte("0123456789")

Functions

func GenerateRandomBytes

func GenerateRandomBytes(n int) ([]byte, error)

GenerateRandomBytes returns securely generated random bytes. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.

func GenerateRandomString

func GenerateRandomString(s int) (string, error)

GenerateRandomString returns a URL-safe, base64 encoded securely generated random string. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.

func RandomIntKey

func RandomIntKey(length int) string

RandomIntKey generates a random key at the given length.

The first time this is called, the rand.Seed will be set to the current time.

func RandomKey

func RandomKey(length int) string

RandomKey generates a random key at the given length.

The first time this is called, the rand.Seed will be set to the current time.

Types

This section is empty.

Jump to

Keyboard shortcuts

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