MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / Int63n

Function Int63n

pkg/random/random.go:26–32  ·  view source on GitHub ↗

Int63n returns a random number in the range [0,n).

(n int64)

Source from the content-addressed store, hash-verified

24
25// Int63n returns a random number in the range [0,n).
26func Int63n(n int64) int64 {
27 i, err := rand.Int(rand.Reader, big.NewInt(int64(n)))
28 if err != nil {
29 panic(err)
30 }
31 return i.Int64()
32}
33
34// Bytes generates a random byte slice of length n.
35func Bytes(n int) []byte {

Callers 6

generateSessionFunction · 0.92
makeNewDevAddrFuncFunction · 0.92
genMACParametersFunction · 0.92
JitterFunction · 0.85
TestPseudoRandomFunction · 0.85
BenchmarkIntnFunction · 0.85

Calls

no outgoing calls

Tested by 4

generateSessionFunction · 0.74
genMACParametersFunction · 0.74
TestPseudoRandomFunction · 0.68
BenchmarkIntnFunction · 0.68