How rand SetString

How rand count in :

count, one := big.NewInt(0), big.NewInt(1)
count.SetString("100000000000000000000000", 10)

i found

    const charset = "0123456789"

var seededRand *rand.Rand = rand.New(
rand.NewSource(time.Now().UnixNano()))

func StringWithCharset(length int, charset string) string {

b := make([]byte, length)
for i := range b {
b[i] = charset[seededRand.Intn(len(charset))]
}
return string(b)
}

func String(length int) string {
return StringWithCharset(length, charset)
}

count := big.NewInt(0)
count.SetString(String(77), 10)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.