rndm

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: MIT Imports: 2 Imported by: 3 modules, 9 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 github.com/longsleep/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