generate

package
v0.0.0-...-4347b6b Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncryptPassword

func EncryptPassword(pw, salt []byte) ([]byte, error)

EncryptPassword encrypts the given password with scrypt and the pre-defined security parameters.

func RandomBytes

func RandomBytes(src rand.Source, n int) []byte

RandomBytes returns a generated bytes with the provided length.

Solution based on SO thread: http://stackoverflow.com/a/31832326/1590256

func RandomString

func RandomString(n int) string

RandomString returns a genrated string with the provided length.

func RandomStringSafe

func RandomStringSafe(n int) string

RandomStringSafe returns a generated string which is safe to use in basic auth passwords.

func Salt

func Salt() ([]byte, error)

Salt returns a secure byte string to use for password securing.

func UUID

func UUID() (string, error)

UUID generates a random UUID according to RFC 4122.

Types

This section is empty.

Jump to

Keyboard shortcuts

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