MCPcopy Index your code
hub / github.com/coder/coder / Int63n

Function Int63n

cryptorand/numbers.go:51–54  ·  view source on GitHub ↗

Int63n returns a non-negative integer in [0,maxVal) as an int64.

(maxVal int64)

Source from the content-addressed store, hash-verified

49
50// Int63n returns a non-negative integer in [0,maxVal) as an int64.
51func Int63n(maxVal int64) (int64, error) {
52 rng, cs := secureRand()
53 return rng.Int63n(maxVal), cs.err
54}
55
56// Intn returns a non-negative integer in [0,maxVal) as an int.
57func Intn(maxVal int) (int, error) {

Callers 3

TestInt63nFunction · 0.92
StartMethod · 0.92
randIntFunction · 0.92

Calls 1

secureRandFunction · 0.85

Tested by 2

TestInt63nFunction · 0.74
randIntFunction · 0.74