Discover Packages
go.thethings.network/lorawan-stack/v3
pkg
random
package
Version:
v3.32.1
Opens a new window with list of versions in this module.
Published: Oct 24, 2024
License: Apache-2.0
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 2
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.
CanJitter checks if the provided duration `d` can be used with the Jitter function with the provided
percentage p.
Int63n returns a random number in the range [0,n).
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].
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.