- Sort Score
- Result 10 results
- Languages All
Results 41 - 50 of 717 for srand (0.04 sec)
-
src/math/rand/example_test.go
rand.Shuffle(len(numbers), func(i, j int) { numbers[i], numbers[j] = numbers[j], numbers[i] letters[i], letters[j] = letters[j], letters[i] }) for i := range numbers { fmt.Printf("%c: %c\n", letters[i], numbers[i]) } } func ExampleIntn() { fmt.Println(rand.Intn(100)) fmt.Println(rand.Intn(100)) fmt.Println(rand.Intn(100))
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Oct 26 16:24:57 UTC 2022 - 4.2K bytes - Viewed (0) -
src/internal/fuzz/mutator.go
} func (m *mutator) rand(n int) int { return m.r.intn(n) } func (m *mutator) randByteOrder() binary.ByteOrder { if m.r.bool() { return binary.LittleEndian } return binary.BigEndian } // chooseLen chooses length of range mutation in range [1,n]. It gives // preference to shorter ranges. func (m *mutator) chooseLen(n int) int { switch x := m.rand(100); { case x < 90:
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Sep 18 20:01:34 UTC 2023 - 6.6K bytes - Viewed (0) -
pkg/apis/batch/fuzzer/fuzzer.go
} }, func(j *batch.JobSpec, c fuzz.Continue) { c.FuzzNoCustom(j) // fuzz self without calling this function again completions := int32(c.Rand.Int31()) parallelism := int32(c.Rand.Int31()) backoffLimit := int32(c.Rand.Int31()) j.Completions = &completions j.Parallelism = ¶llelism j.BackoffLimit = &backoffLimit j.ManualSelector = pointer.Bool(c.RandBool())
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Tue Mar 05 17:25:15 UTC 2024 - 3K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/pkg/apis/meta/fuzzer/fuzzer.go
partLen := c.Rand.Intn(64) // len is [0, 63] if !canBeEmpty { partLen = c.Rand.Intn(63) + 1 // len is [1, 63] } runes := make([]rune, partLen) if partLen == 0 { return string(runes) } runes[0] = validStartEnd[c.Rand.Intn(len(validStartEnd))].choose(c.Rand) for i := range runes[1:] { runes[i+1] = validMiddle[c.Rand.Intn(len(validMiddle))].choose(c.Rand) }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Fri May 03 15:12:26 UTC 2024 - 9.9K bytes - Viewed (0) -
internal/dsync/utils.go
package dsync import ( "math/rand" "time" ) func backoffWait(min, unit, cap time.Duration) func(*rand.Rand, uint) time.Duration { if unit > time.Hour { // Protect against integer overflow panic("unit cannot exceed one hour") } return func(r *rand.Rand, attempt uint) time.Duration { sleep := min sleep += unit * time.Duration(attempt)
Registered: Sun Jun 16 00:44:34 UTC 2024 - Last Modified: Sat May 13 15:42:21 UTC 2023 - 1.2K bytes - Viewed (0) -
src/crypto/tls/generate_cert.go
case "": if *ed25519Key { _, priv, err = ed25519.GenerateKey(rand.Reader) } else { priv, err = rsa.GenerateKey(rand.Reader, *rsaBits) } case "P224": priv, err = ecdsa.GenerateKey(elliptic.P224(), rand.Reader) case "P256": priv, err = ecdsa.GenerateKey(elliptic.P256(), rand.Reader) case "P384": priv, err = ecdsa.GenerateKey(elliptic.P384(), rand.Reader) case "P521":
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Aug 08 15:22:02 UTC 2022 - 4.8K bytes - Viewed (0) -
staging/src/k8s.io/apiserver/pkg/util/flowcontrol/gen_test.go
// genPL creates a valid PriorityLevelConfiguration with the given // name and randomly generated spec. The given name must not be one // of the mandatory ones. func genPL(rng *rand.Rand, name string) *flowcontrol.PriorityLevelConfiguration { plc := &flowcontrol.PriorityLevelConfiguration{ ObjectMeta: metav1.ObjectMeta{Name: name}, Spec: flowcontrol.PriorityLevelConfigurationSpec{
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Mon Oct 30 12:18:40 UTC 2023 - 24.8K bytes - Viewed (0) -
src/crypto/rand/util.go
package rand import ( "crypto/internal/randutil" "errors" "io" "math/big" ) // Prime returns a number of the given bit length that is prime with high probability. // Prime will return error for any error returned by [rand.Read] or if bits < 2. func Prime(rand io.Reader, bits int) (*big.Int, error) { if bits < 2 { return nil, errors.New("crypto/rand: prime size must be at least 2-bit") }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Oct 13 17:09:47 UTC 2023 - 2.4K bytes - Viewed (0) -
src/compress/flate/testdata/huffman-rand-limit.wb.expect
Klaus Post <******@****.***> 1457448890 +0100
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Mar 11 17:40:52 UTC 2016 - 186 bytes - Viewed (0) -
src/crypto/internal/edwards25519/field/fe_test.go
} ) func generateWeirdFieldElement(rand *mathrand.Rand) Element { return Element{ weirdLimbs52[rand.Intn(len(weirdLimbs52))], weirdLimbs51[rand.Intn(len(weirdLimbs51))], weirdLimbs51[rand.Intn(len(weirdLimbs51))], weirdLimbs51[rand.Intn(len(weirdLimbs51))], weirdLimbs51[rand.Intn(len(weirdLimbs51))], } } func (Element) Generate(rand *mathrand.Rand, size int) reflect.Value { if rand.Intn(2) == 0 {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Aug 28 17:26:17 UTC 2023 - 13.9K bytes - Viewed (0)