Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSeedInt64Crypto ¶ added in v0.41.0
NewSeedInt64Crypto creates an `int64` seed value for `math/rand`. This is preferred over `NewSeedInt64Time()`. See: https://stackoverflow.com/a/54491783/1908967
func NewSeedInt64Time ¶ added in v0.41.0
func NewSeedInt64Time() int64
NewSeedInt64Time creates an `int64` seed value for `math/rand` based on `time.Now()`. This can have reduced entropy if used constantly throughout with shourl time differentials. See: https://stackoverflow.com/a/12321192/1908967
func RandString ¶ added in v0.44.0
RandString returns a random string of length `length` using the supplied alphabet. If no alphabet is provided, `AlphabetBase16`, aha hexadecimal is used.
Types ¶
type CryptoRandSource ¶ added in v0.47.0
type CryptoRandSource struct{}
CryptoRandSource is a `crypto/rand` backed source that satisfies the `math/rand.Source` interface definition. It can be used as `r := rand.New(NewCryptoRandSource())` See: https://stackoverflow.com/a/35208651/1908967
func NewCryptoRandSource ¶ added in v0.47.0
func NewCryptoRandSource() CryptoRandSource
func (CryptoRandSource) Int63 ¶ added in v0.47.0
func (CryptoRandSource) Int63() int64
func (CryptoRandSource) Seed ¶ added in v0.47.0
func (CryptoRandSource) Seed(int64)