Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for encodePerm (0.15 sec)

  1. src/math/rand/rand_test.go

    		r.Shuffle(n, func(i, j int) { t.Fatalf("swap called, n=%d i=%d j=%d", n, i, j) })
    	}
    }
    
    // encodePerm converts from a permuted slice of length n, such as Perm generates, to an int in [0, n!).
    // See https://en.wikipedia.org/wiki/Lehmer_code.
    // encodePerm modifies the input slice.
    func encodePerm(s []int) int {
    	// Convert to Lehmer code.
    	for i, x := range s {
    		r := s[i+1:]
    		for j, y := range r {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 16.9K bytes
    - Viewed (0)
  2. src/math/rand/v2/rand_test.go

    		r.Shuffle(n, func(i, j int) { t.Fatalf("swap called, n=%d i=%d j=%d", n, i, j) })
    	}
    }
    
    // encodePerm converts from a permuted slice of length n, such as Perm generates, to an int in [0, n!).
    // See https://en.wikipedia.org/wiki/Lehmer_code.
    // encodePerm modifies the input slice.
    func encodePerm(s []int) int {
    	// Convert to Lehmer code.
    	for i, x := range s {
    		r := s[i+1:]
    		for j, y := range r {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 17.4K bytes
    - Viewed (0)
  3. src/encoding/gob/encoder_test.go

    // See Issue 16204.
    func TestCatchInvalidNilValue(t *testing.T) {
    	encodeErr, panicErr := encodeAndRecover(nil)
    	if panicErr != nil {
    		t.Fatalf("panicErr=%v, should not panic encoding untyped nil", panicErr)
    	}
    	if encodeErr == nil {
    		t.Errorf("got err=nil, want non-nil error when encoding untyped nil value")
    	} else if !strings.Contains(encodeErr.Error(), "nil value") {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 29.7K bytes
    - Viewed (0)
  4. security/pkg/pki/util/generate_csr.go

    	}
    
    	csrBytes, err := x509.CreateCertificateRequest(rand.Reader, template, crypto.PrivateKey(priv))
    	if err != nil {
    		return nil, nil, fmt.Errorf("CSR creation failed (%v)", err)
    	}
    
    	csr, privKey, err := encodePem(true, csrBytes, priv, options.PKCS8Key)
    	return csr, privKey, err
    }
    
    // GenCSRTemplate generates a certificateRequest template with the given options.
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Nov 06 12:48:53 UTC 2023
    - 4.1K bytes
    - Viewed (0)
  5. security/pkg/pki/util/generate_cert.go

    	if err != nil {
    		return nil, nil, fmt.Errorf("cert generation fails at X509 cert creation (%v)", err)
    	}
    
    	pemCert, pemKey, err := encodePem(false, certBytes, priv, options.PKCS8Key)
    	return pemCert, pemKey, err
    }
    
    func publicKey(priv any) any {
    	switch k := priv.(type) {
    	case *rsa.PrivateKey:
    		return &k.PublicKey
    	case *ecdsa.PrivateKey:
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Aug 02 14:34:38 UTC 2023
    - 14.2K bytes
    - Viewed (0)
Back to top