rndm

package module
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: MIT Imports: 2 Imported by: 18

README

rndm GoDoc

Rndm is a Go package to provide helper functions which create cryptographically secure random values out of random data.

Installation

go get stash.kopano.io/kgol/rndm

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateRandomBytes

func GenerateRandomBytes(n int) []byte

GenerateRandomBytes returns securely generated random bytes. It will panic when the system fails to provide enough secure random data.

func GenerateRandomString

func GenerateRandomString(s int) string

GenerateRandomString returns a URL-safe, base64 encoded securely generated random string. It will panic if the system fails to provide secure random data.

func ReadRandomBytes

func ReadRandomBytes(b []byte) (n int, err error)

ReadRandomBytes is a helper function that reads random data into the provided []byte. Tt returns the number of random bytes read and an error if fewer bytes were read.

Types

This section is empty.

Jump to

Keyboard shortcuts

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