Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 2,395 for rand (0.17 sec)

  1. 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 28 19:28:10 GMT 2024
    - Last Modified: Fri Feb 02 00:13:57 GMT 2024
    - 6.8K bytes
    - Viewed (0)
  2. 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 28 19:28:10 GMT 2024
    - Last Modified: Fri Mar 01 21:09:42 GMT 2024
    - 11.4K bytes
    - Viewed (0)
  3. 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 30 11:13:12 GMT 2024
    - Last Modified: Wed Jan 24 20:54:27 GMT 2024
    - 7.7K bytes
    - Viewed (0)
  4. 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 21 19:28:08 GMT 2024
    - Last Modified: Tue Nov 21 01:09:35 GMT 2023
    - 12.2K bytes
    - Viewed (0)
  5. 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 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 5.1K bytes
    - Viewed (1)
  6. 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 28 19:28:10 GMT 2024
    - Last Modified: Tue Mar 19 20:28:10 GMT 2024
    - 6.4K bytes
    - Viewed (0)
  7. 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 28 19:28:10 GMT 2024
    - Last Modified: Sat May 13 15:42:21 GMT 2023
    - 1.2K bytes
    - Viewed (0)
  8. cmd/erasure-common.go

    package cmd
    
    import (
    	"context"
    	"fmt"
    	"io"
    	"math/rand"
    	"sync"
    	"time"
    
    	"github.com/minio/pkg/v2/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)
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sun Apr 28 17:53:50 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  9. cmd/erasure-metadata-utils_test.go

    	testShuffleDisks(t, z)
    }
    
    func Test_hashOrder(t *testing.T) {
    	for x := 1; x < 17; x++ {
    		t.Run(fmt.Sprintf("%d", x), func(t *testing.T) {
    			var first [17]int
    			rng := rand.New(rand.NewSource(0))
    			var tmp [16]byte
    			rng.Read(tmp[:])
    			prefix := hex.EncodeToString(tmp[:])
    			for i := 0; i < 10000; i++ {
    				rng.Read(tmp[:])
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 7.4K bytes
    - Viewed (0)
  10. cmd/site-replication-utils.go

    		peerResyncMap: make(map[string]resyncState),
    	}
    	go s.save(ctx)
    	go s.init(ctx)
    	return &s
    }
    
    // init site resync metrics
    func (sm *siteResyncMetrics) init(ctx context.Context) {
    	r := rand.New(rand.NewSource(time.Now().UnixNano()))
    	// Run the site resync metrics load in a loop
    	for {
    		if err := sm.load(ctx, newObjectLayerFn()); err == nil {
    			<-ctx.Done()
    			return
    		}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 8.9K bytes
    - Viewed (1)
Back to top