random

package
v0.0.0-...-d931726 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: MIT Imports: 3 Imported by: 2

Documentation

Overview

Package random provides some general purpose cryptographically pseudo-random utilities.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidLen = errors.New("invalid length")

Functions

func GetRandBase64Str

func GetRandBase64Str(len int) (string, error)

GetRandBase64Str creates a cryptographically randomly generated set of bytes with the length of len which is returned as base64 encoded string.

func GetRandByteArray

func GetRandByteArray(len int) (data []byte, err error)

GetRandByteArray creates a cryptographically randomly generated set of bytes with the length of len.

func MustGetRandBase64Str

func MustGetRandBase64Str(len int) string

MustGetRandBase64Str executes GetRandBase64Str and panics if an error was returned.

func MustGetRandByteArray

func MustGetRandByteArray(len int) []byte

MustGetRandByteArray executes GetRandByteArray and panics if an error was returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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