random

package
v0.0.0-...-1ad4281 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes

func Bytes(n int64) []byte

Bytes returns a secure random byte array

func FastBytes

func FastBytes(n int64) []byte

FastBytes returns a fast pseudorandom byte array

func FastInt

func FastInt(max int64) int64

FastInt returns a fast pseudorandom int between 0 and max if max <= 0 them max is 64

func FastString

func FastString(n int) string

FastString returns a fast pseudorandom string

func Int

func Int(max int64) int64

Int returns a secure random int between 0 and max if max <= 0 them max is 64

func String

func String(n int) string

String returns a secure random string

func StringBase58

func StringBase58(n int) string

StringBase58 returns a secure random base58 string

up to 2.5x faster than String(n) with only 3 allocations

func StringBase64

func StringBase64(n int) string

StringBase64 returns a secure random Url Safe string of n*4/3 min length

up to 4x faster than String(n) with only 3 allocations

Types

This section is empty.

Jump to

Keyboard shortcuts

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