MCPcopy Create free account
hub / github.com/ddd/gpb / randomPhoneDigits

Function randomPhoneDigits

tools/bg_gen/main.go:32–39  ·  view source on GitHub ↗

Function to generate a random 7-digit number as string

()

Source from the content-addressed store, hash-verified

30
31// Function to generate a random 7-digit number as string
32func randomPhoneDigits() string {
33 seededRand := rand.New(rand.NewSource(time.Now().UnixNano()))
34 digits := make([]byte, 7)
35 for i := range digits {
36 digits[i] = byte(seededRand.Intn(10) + '0')
37 }
38 return string(digits)
39}
40
41// TokenResponse represents the JSON response for the API
42type TokenResponse struct {

Callers 1

generateBgTokenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected