Discover Packages
github.com/aureliar8/ttn-fork
pkg
random
package
Version:
v0.0.0-...-5090d89
Opens a new window with list of versions in this module.
Published: Apr 1, 2021
License: Apache-2.0
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package random implements goroutine-safe utilities on top of a secure random source.
Bytes generates a random byte slice of length n. This func uses the global TTNRandom.
Intn returns a random number in the range [0,n). This func uses the global TTNRandom.
Jitter returns a random number around d where p is the maximum percentage of change applied to d.
With d=100 and p=0.1, the duration returned will be in [90,110].
Read fills the byte slice with random bytes. This func uses the global TTNRandom.
String returns a random string of length n, it uses the characters of base64.URLEncoding.
This func uses the global TTNRandom.
Interface for random.
New returns a new Random, in most cases you can also just use the global funcs.
TTNRandom is used as a wrapper around crypto/rand.
func (*TTNRandom) Bytes ¶
Bytes generates a random byte slice of length n.
func (*TTNRandom) Intn ¶
Intn returns a random number in the range [0,n).
func (*TTNRandom) String ¶
String returns a random string of length n, it uses the characters of base64.URLEncoding.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.