Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 85 for random (0.19 sec)

  1. cmd/benchmark-utils_test.go

    }
    
    // randomly picks a character and returns its equivalent byte array.
    func getRandomByte() []byte {
    	const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
    	// seeding the random number generator.
    	rand.Seed(UTCNow().UnixNano())
    	// pick a character randomly.
    	return []byte{letterBytes[rand.Intn(len(letterBytes))]}
    }
    
    // picks a random byte and repeats it to size bytes.
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Dec 23 15:46:00 GMT 2022
    - 8.2K bytes
    - Viewed (0)
  2. internal/crypto/key_test.go

    	}
    }
    
    var generateKeyTests = []struct {
    	ExtKey     [32]byte
    	Random     io.Reader
    	ShouldPass bool
    }{
    	{ExtKey: [32]byte{}, Random: nil, ShouldPass: true},              // 0
    	{ExtKey: [32]byte{}, Random: rand.Reader, ShouldPass: true},      // 1
    	{ExtKey: [32]byte{}, Random: shortRandom(32), ShouldPass: true},  // 2
    	{ExtKey: [32]byte{}, Random: shortRandom(31), ShouldPass: false}, // 3
    }
    
    func TestGenerateKey(t *testing.T) {
    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)
  3. internal/auth/credentials.go

    // GenerateAccessKey returns a new access key generated randomly using
    // the given io.Reader. If random is nil, crypto/rand.Reader is used.
    // If length <= 0, the access key length is chosen automatically.
    //
    // GenerateAccessKey returns an error if length is too small for a valid
    // access key.
    func GenerateAccessKey(length int, random io.Reader) (string, error) {
    	if random == nil {
    		random = rand.Reader
    	}
    	if length <= 0 {
    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)
  4. cmd/xl-storage-format-utils.go

    // Trivial collisions are avoided, but this is by no means a strong hash.
    func hashDeterministicString(m map[string]string) uint64 {
    	// Seed (random)
    	crc := uint64(0xc2b40bbac11a7295)
    	// Xor each value to make order independent
    	for k, v := range m {
    		// Separate key and value with an individual xor with a random number.
    		// Add values of each, so they cannot be trivially collided.
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 11 17:45:28 GMT 2024
    - 4.7K bytes
    - Viewed (0)
  5. internal/grid/benchmark_test.go

    				var ops int64
    				var lat int64
    				b.SetParallelism(par)
    				b.RunParallel(func(pb *testing.PB) {
    					rng := rand.New(rand.NewSource(time.Now().UnixNano()))
    					n := 0
    					var latency int64
    					managers := grid.Managers
    					hosts := grid.Hosts
    					for pb.Next() {
    						// Pick a random manager.
    						src, dst := rng.Intn(len(managers)), rng.Intn(len(managers))
    						if src == dst {
    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)
  6. istioctl/pkg/proxystatus/proxystatus_test.go

    			args:          strings.Split("deployment/random-gibberish", " "),
    			wantException: true,
    		},
    		{ // case 3: supplying nonexistent deployment name
    			args:          strings.Split("deployment/random-gibberish.default", " "),
    			wantException: true,
    		},
    		{ // case 4: supplying nonexistent deployment name in nonexistent namespace
    			args:          strings.Split("deployment/random-gibberish.bogus", " "),
    			wantException: true,
    		},
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Fri Mar 15 08:28:50 GMT 2024
    - 5.5K bytes
    - Viewed (0)
  7. internal/kms/single-key.go

    			APICode:        "KMS.InternalException",
    			Err:            errors.New("invalid algorithm: " + algorithm),
    		}
    	}
    
    	nonce, err := sioutil.Random(aead.NonceSize())
    	if err != nil {
    		return DEK{}, err
    	}
    
    	plaintext, err := sioutil.Random(32)
    	if err != nil {
    		return DEK{}, err
    	}
    	associatedData, _ := context.MarshalText()
    	ciphertext := aead.Seal(nil, nonce, plaintext, associatedData)
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Mar 01 21:09:42 GMT 2024
    - 7.9K bytes
    - Viewed (0)
  8. istioctl/pkg/proxyconfig/proxyconfig_test.go

    			args:           strings.Split("clusters deployment/random-gibberish", " "),
    			expectedString: `"deployment/random-gibberish" does not refer to a pod`,
    			wantException:  true,
    		},
    		{ // supplying nonexistent deployment name in nonexistent namespace
    			args:           strings.Split("endpoint deployment/random-gibberish.bogus", " "),
    			expectedString: `"deployment/random-gibberish" does not refer to a pod`,
    			wantException:  true,
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Wed Apr 10 21:51:29 GMT 2024
    - 8.9K bytes
    - Viewed (0)
  9. istioctl/pkg/tag/generate_test.go

    					Service: &admitv1.ServiceReference{
    						Namespace: "default",
    						Name:      "istiod-revision",
    					},
    					CABundle: []byte("ca"),
    				},
    			},
    		},
    	}
    	remoteInjectionURL             = "https://random.host.com/inject/cluster/cluster1/net/net1"
    	revisionCanonicalWebhookRemote = admitv1.MutatingWebhookConfiguration{
    		ObjectMeta: metav1.ObjectMeta{
    			Name:   "istio-sidecar-injector-revision",
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Tue Jan 16 17:43:49 GMT 2024
    - 12.1K bytes
    - Viewed (0)
  10. cmd/erasure_test.go

    }
    
    func TestErasureEncodeDecode(t *testing.T) {
    	data := make([]byte, 256)
    	if _, err := io.ReadFull(rand.Reader, data); err != nil {
    		t.Fatalf("Failed to read random data: %v", err)
    	}
    	for i, test := range erasureEncodeDecodeTests {
    		buffer := make([]byte, len(data), 2*len(data))
    		copy(buffer, data)
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Jul 25 19:37:26 GMT 2022
    - 4.8K bytes
    - Viewed (0)
Back to top