random

package
v1.68.2 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: MIT Imports: 4 Imported by: 51

Documentation

Overview

Package random holds a few functions for working with random numbers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Password

func Password(bits int) (password string, err error)

Password creates a crypto strong password which is just about memorable. The password is composed of printable ASCII characters from the URL encoding base64 alphabet (A-Za-z0-9_-).

Requires password strength in bits. 64 is just about memorable 128 is secure

func String

func String(n int) string

String create a random string for test purposes.

Do not use these for passwords.

func StringFn added in v1.56.0

func StringFn(n int, randReader io.Reader) string

StringFn create a random string for test purposes using the random number generator function passed in.

Do not use these for passwords.

Types

This section is empty.

Jump to

Keyboard shortcuts

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