Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 114 for rand1 (0.06 sec)

  1. src/runtime/rand.go

    	mp.chacha8.Init64(seed)
    	mp.cheaprand = rand()
    }
    
    // randn is like rand() % n but faster.
    // Do not change signature: used via linkname from other packages.
    //
    //go:nosplit
    //go:linkname randn
    func randn(n uint32) uint32 {
    	// See https://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction/
    	return uint32((uint64(uint32(rand())) * uint64(n)) >> 32)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 31 14:32:47 UTC 2024
    - 8K bytes
    - Viewed (0)
  2. src/crypto/rand/rand.go

    // Copyright 2010 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    // Package rand implements a cryptographically secure
    // random number generator.
    package rand
    
    import "io"
    
    // Reader is a global, shared instance of a cryptographically
    // secure random number generator.
    //
    //   - On Linux, FreeBSD, Dragonfly, and Solaris, Reader uses getrandom(2)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 19 20:02:21 UTC 2024
    - 1.5K bytes
    - Viewed (0)
  3. src/crypto/internal/boring/rand.go

    qmuntal <******@****.***> 1689090977 +0200
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 20 17:51:31 UTC 2023
    - 696 bytes
    - Viewed (0)
  4. api/go1.22.txt

    pkg math/rand/v2, method (*Rand) Int32() int32 #61716
    pkg math/rand/v2, method (*Rand) Int32N(int32) int32 #61716
    pkg math/rand/v2, method (*Rand) Int64() int64 #61716
    pkg math/rand/v2, method (*Rand) Int64N(int64) int64 #61716
    pkg math/rand/v2, method (*Rand) IntN(int) int #61716
    pkg math/rand/v2, method (*Rand) NormFloat64() float64 #61716
    pkg math/rand/v2, method (*Rand) Perm(int) []int #61716
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 24 20:54:27 UTC 2024
    - 7.7K bytes
    - Viewed (0)
  5. src/math/rand/v2/example_test.go

    }
    
    func ExamplePerm() {
    	for _, value := range rand.Perm(3) {
    		fmt.Println(value)
    	}
    
    	// Unordered output: 1
    	// 2
    	// 0
    }
    
    func ExampleN() {
    	// Print an int64 in the half-open interval [0, 100).
    	fmt.Println(rand.N(int64(100)))
    
    	// Sleep for a random duration between 0 and 100 milliseconds.
    	time.Sleep(rand.N(100 * time.Millisecond))
    }
    
    func ExampleShuffle() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 30 17:09:26 UTC 2023
    - 4.4K bytes
    - Viewed (0)
  6. 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)
  7. 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 = &parallelism
    			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)
  8. 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)
  9. cmd/erasure-common.go

    package cmd
    
    import (
    	"context"
    	"fmt"
    	"io"
    	"math/rand"
    	"sync"
    	"time"
    
    	"github.com/minio/pkg/v3/sync/errgroup"
    )
    
    func (er erasureObjects) getOnlineDisks() (newDisks []StorageAPI) {
    	disks := er.getDisks()
    	var wg sync.WaitGroup
    	var mu sync.Mutex
    	r := rand.New(rand.NewSource(time.Now().UnixNano()))
    	for _, i := range r.Perm(len(disks)) {
    		i := i
    		wg.Add(1)
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  10. src/crypto/internal/edwards25519/scalar_test.go

    // weighted towards high, low, and edge values.
    func (Scalar) Generate(rand *mathrand.Rand, size int) reflect.Value {
    	var s [32]byte
    	diceRoll := rand.Intn(100)
    	switch {
    	case diceRoll == 0:
    	case diceRoll == 1:
    		s = scOneBytes
    	case diceRoll == 2:
    		s = scalarMinusOneBytes
    	case diceRoll < 5:
    		// Generate a low scalar in [0, 2^125).
    		rand.Read(s[:16])
    		s[15] &= (1 << 5) - 1
    	case diceRoll < 10:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 28 17:26:17 UTC 2023
    - 7.6K bytes
    - Viewed (0)
Back to top