rndbytes

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package rndbytes is a fast pseudo random []byte generator. It uses a rand.Source64 together with sync.Mutex which is safe for concurrent use by multiple goroutines. The source is seeded at package init. For random numbers suitable for security-sensitive work, see the crypto/rand package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBytes

func GetBytes(n int, allowFirstDash bool) []byte

GetBytes returns []byte of n length filled with random characters from "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_" set. When allowFirstDash param is false the first byte is guaranteed NOT to be a '-' (dash)

func GetInt

func GetInt() int

GetInt returns a random int from seeded rand.Source64

Types

This section is empty.

Jump to

Keyboard shortcuts

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