rand

package
v0.0.0-...-a41d4d2 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2017 License: MIT Imports: 2 Imported by: 3

Documentation

Index

Constants

View Source
const RememberTokenBytes = 32

Variables

This section is empty.

Functions

func Bytes

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

Bytes will help us generate n random bytes, or will return an error if there was one. This uses the crypto/rand package so it is safe to use with things like remember tokens.

func NBytes

func NBytes(base64String string) (int, error)

NBytes returns the number of bytes used in the base64 URL encoded string

func RememberToken

func RememberToken() (string, error)

RememberToken is a helper function designed to generate remember tokens of a predetermined byte size.

func String

func String(nBytes int) (string, error)

String will generate a byte slice of size nBytes and then return a string that is the base64 URL encoded version of that byte slice

Types

This section is empty.

Jump to

Keyboard shortcuts

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