MCPcopy
hub / github.com/gotify/server / randIntn

Function randIntn

auth/token.go:18–25  ·  view source on GitHub ↗
(n int)

Source from the content-addressed store, hash-verified

16)
17
18func randIntn(n int) int {
19 max := big.NewInt(int64(n))
20 res, err := rand.Int(randReader, max)
21 if err != nil {
22 panic("random source is not available")
23 }
24 return int(res.Int64())
25}
26
27// GenerateNotExistingToken receives a token generation func and a func to check whether the token exists, returns a unique token.
28func GenerateNotExistingToken(generateToken func() string, tokenExists func(token string) bool) string {

Callers 3

generateRandomStringFunction · 0.85
initFunction · 0.85

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…