Documentation ¶
Index ¶
- Constants
- func Bool() (bool, error)
- func Float32() (float32, error)
- func Float64() (float64, error)
- func HexString(size int) (string, error)
- func Int() (int, error)
- func Int31() (int32, error)
- func Int31n(max int32) (int32, error)
- func Int63() (int64, error)
- func Int63n(max int64) (int64, error)
- func Intn(max int) (int, error)
- func Sha1String() (string, error)
- func String(size int) (string, error)
- func StringCharset(charSetStr string, size int) (string, error)
- func Uint32() (uint32, error)
- func Uint64() (uint64, error)
- func UnbiasedModulo32(v uint32, n int32) (int32, error)
Constants ¶
View Source
const ( // Numeric includes decimal numbers (0-9) Numeric = "0123456789" // Upper is uppercase characters in the Latin alphabet Upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" // Lower is lowercase characters in the Latin alphabet Lower = "abcdefghijklmnopqrstuvwxyz" // Alpha is upper or lowercase alphabetic characters Alpha = Upper + Lower // Default is uppercase, lowercase, or numeric characters Default = Numeric + Alpha // Hex is hexadecimal lowercase characters Hex = "0123456789abcdef" // Human creates strings which are easily distinguishable from // others created with the same charset. It contains most lowercase // alphanumeric characters without 0,o,i,1,l. Human = "23456789abcdefghjkmnpqrstuvwxyz" )
Charsets
Variables ¶
This section is empty.
Functions ¶
func Sha1String ¶
Sha1String returns a 40-character hexadecimal string, which matches the length of a SHA-1 hash (160 bits).
func StringCharset ¶
StringCharset generates a random string using the provided charset and size
func UnbiasedModulo32 ¶
UnbiasedModulo32 uniformly modulos v by n over a sufficiently large data set, regenerating v if necessary. n must be > 0. All input bits in v must be fully random, you cannot cast a random uint8/uint16 for input into this function.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.