rand

package
v0.0.0-...-9b15d4d Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes

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

Bytes takes an integer and generates a random byte slice of length n this uses the crypto/rand package so is safe to use with remember tokens

func NBytes

func NBytes(base64String string) (int, error)

NBytes returns the number of bytes in a base64 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