Categorygithub.com/adam-hanna/randomstrings
modulepackage
0.0.0-20160715001758-88fd7c52a2c7
Repository: https://github.com/adam-hanna/randomstrings.git
Documentation: pkg.go.dev

# README

Random Strings in GoLang

This simple library creates random strings on N length

Thanks to @elithrar for the code! Source: https://elithrar.github.io/article/generating-secure-random-numbers-crypto-rand/

Usage

import "github.com/adam-hanna/randomstrings"

sRand, err := randomstrings.GenerateRandomString(16) // generates a 16 digit random string
if err != nil {
	// panic!
}
log.Println(sRand)

# Functions

GenerateRandomBytes returns securely generated random bytes.
GenerateRandomString returns a URL-safe, base64 encoded securely generated random string.