Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 3,881 for rand (0.15 sec)

  1. internal/dsync/locked_rand.go

    // along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
    package dsync
    
    import (
    	"math/rand"
    	"sync"
    )
    
    // lockedRandSource provides protected rand source, implements rand.Source interface.
    type lockedRandSource struct {
    	lk  sync.Mutex
    	src rand.Source
    }
    
    // Int63 returns a non-negative pseudo-random 63-bit integer as an int64.
    func (r *lockedRandSource) Int63() (n int64) {
    Go
    - Registered: Sun Apr 14 19:28:10 GMT 2024
    - Last Modified: Mon Oct 18 15:39:59 GMT 2021
    - 1.3K bytes
    - Viewed (0)
  2. cmd/metacache-entries_test.go

    data/huffman-pi.wb.expect-noinput", "src/compress/flate/testdata/huffman-rand-1k.dyn.expect", "src/compress/flate/testdata/huffman-rand-1k.dyn.expect-noinput", "src/compress/flate/testdata/huffman-rand-1k.golden", "src/compress/flate/testdata/huffman-rand-1k.in", "src/compress/flate/testdata/huffman-rand-1k.wb.expect", "src/compress/flate/testdata/huffman-rand-1k.wb.expect-noinput", "src/compress/flate/testdata/huffman-rand-limit.dyn.expect", "src/compress/flate/testdata/huffman-rand-limit.dyn.expect-noinput",...
    Go
    - Registered: Sun Apr 14 19:28:10 GMT 2024
    - Last Modified: Sun Jan 02 17:15:06 GMT 2022
    - 31.6K bytes
    - Viewed (0)
  3. internal/crypto/key_test.go

    // along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
    package crypto
    
    import (
    	"bytes"
    	"crypto/rand"
    	"encoding/hex"
    	"io"
    	"testing"
    
    	"github.com/minio/minio/internal/logger"
    )
    
    var shortRandom = func(limit int64) io.Reader { return io.LimitReader(rand.Reader, limit) }
    
    func recoverTest(i int, shouldPass bool, t *testing.T) {
    	if err := recover(); err == nil && !shouldPass {
    Go
    - Registered: Sun Apr 14 19:28:10 GMT 2024
    - Last Modified: Fri Feb 02 00:13:57 GMT 2024
    - 6.8K bytes
    - Viewed (0)
  4. cmd/dynamic-timeouts_test.go

    	var wg sync.WaitGroup
    	for i := 0; i < runtime.GOMAXPROCS(0); i++ {
    		wg.Add(1)
    		rng := rand.New(rand.NewSource(int64(i)))
    		go func() {
    			defer wg.Done()
    			for i := 0; i < 100; i++ {
    				for j := 0; j < 100; j++ {
    					timeout.LogSuccess(time.Duration(float64(time.Second) * rng.Float64()))
    				}
    				to := timeout.Timeout()
    				if to < time.Millisecond || to > time.Second {
    Go
    - Registered: Sun Apr 14 19:28:10 GMT 2024
    - Last Modified: Fri Oct 14 10:08:40 GMT 2022
    - 5.4K bytes
    - Viewed (0)
  5. 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
    Plain Text
    - Registered: Tue Apr 16 11:13:10 GMT 2024
    - Last Modified: Wed Jan 24 20:54:27 GMT 2024
    - 7.7K bytes
    - Viewed (0)
  6. internal/auth/credentials.go

    	accessKey, err = GenerateAccessKey(accessKeyMaxLen, rand.Reader)
    	if err != nil {
    		return "", "", err
    	}
    	secretKey, err = GenerateSecretKey(secretKeyMaxLen, rand.Reader)
    	if err != nil {
    		return "", "", err
    	}
    	return accessKey, secretKey, nil
    }
    
    // GenerateAccessKey returns a new access key generated randomly using
    // the given io.Reader. If random is nil, crypto/rand.Reader is used.
    Go
    - Registered: Sun Apr 14 19:28:10 GMT 2024
    - Last Modified: Fri Mar 01 21:09:42 GMT 2024
    - 11.4K bytes
    - Viewed (0)
  7. internal/grid/benchmark_test.go

    			return &testResponse{
    				OrgNum:    req.Num,
    				OrgString: req.String,
    				Embedded:  *req,
    			}, nil
    		}))
    		errFatal(err)
    	}
    	const payloadSize = 512
    	rng := rand.New(rand.NewSource(time.Now().UnixNano()))
    	payload := make([]byte, payloadSize)
    	_, err = rng.Read(payload)
    	errFatal(err)
    
    	// Wait for all to connect
    	// Parallel writes per server.
    	b.Run("bytes", func(b *testing.B) {
    Go
    - Registered: Sun Apr 07 19:28:10 GMT 2024
    - Last Modified: Tue Nov 21 01:09:35 GMT 2023
    - 12.2K bytes
    - Viewed (0)
  8. cmd/callhome.go

    	if !globalCallhomeConfig.Enabled() {
    		return
    	}
    
    	go func() {
    		r := rand.New(rand.NewSource(time.Now().UnixNano()))
    		// Leader node (that successfully acquires the lock inside runCallhome)
    		// will keep performing the callhome. If the leader goes down for some reason,
    		// the lock will be released and another node will acquire it and take over
    		// because of this loop.
    		for {
    			if !globalCallhomeConfig.Enabled() {
    Go
    - Registered: Sun Apr 14 19:28:10 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 5.1K bytes
    - Viewed (1)
  9. internal/crypto/key.go

    type ObjectKey [32]byte
    
    // GenerateKey generates a unique ObjectKey from a 256 bit external key
    // and a source of randomness. If random is nil the default PRNG of the
    // system (crypto/rand) is used.
    func GenerateKey(extKey []byte, random io.Reader) (key ObjectKey) {
    	if random == nil {
    		random = rand.Reader
    	}
    	if len(extKey) != 32 { // safety check
    Go
    - Registered: Sun Apr 14 19:28:10 GMT 2024
    - Last Modified: Tue Mar 19 20:28:10 GMT 2024
    - 6.4K bytes
    - Viewed (0)
  10. 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)
    Go
    - Registered: Sun Apr 14 19:28:10 GMT 2024
    - Last Modified: Sat May 13 15:42:21 GMT 2023
    - 1.2K bytes
    - Viewed (0)
Back to top