Search Options

Results per page
Sort
Preferred Languages
Advance

Results 61 - 70 of 231 for rand (0.1 sec)

  1. src/crypto/rand/rand_windows.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    // Windows cryptographically secure pseudorandom number
    // generator.
    
    package rand
    
    import (
    	"internal/syscall/windows"
    )
    
    func init() { Reader = &rngReader{} }
    
    type rngReader struct{}
    
    func (r *rngReader) Read(b []byte) (int, error) {
    	if err := windows.ProcessPrng(b); err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 20 18:35:47 UTC 2023
    - 488 bytes
    - Viewed (0)
  2. src/compress/flate/writer_test.go

    	// Test so much we cross a good number of block boundaries.
    	var length = maxStoreBlockSize*30 + 500
    	if testing.Short() {
    		length /= 10
    	}
    
    	// Create a random, but compressible stream.
    	rng := rand.New(rand.NewSource(1))
    	t1 := make([]byte, length)
    	for i := range t1 {
    		t1[i] = byte(rng.Int63() & 7)
    	}
    
    	// Do our first encode.
    	var b1 bytes.Buffer
    	br := bytes.NewBuffer(t1)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 20 18:41:18 UTC 2020
    - 5.4K bytes
    - Viewed (0)
  3. src/crypto/rand/rand_getrandom.go

    // Copyright 2014 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.
    
    //go:build dragonfly || freebsd || linux || solaris
    
    package rand
    
    import (
    	"internal/syscall/unix"
    	"runtime"
    	"syscall"
    )
    
    func init() {
    	var maxGetRandomRead int
    	switch runtime.GOOS {
    	case "linux", "android":
    		// Per the manpage:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 07 00:26:43 UTC 2023
    - 1.4K bytes
    - Viewed (0)
  4. src/cmd/go/internal/par/work.go

    		v.err = ErrCacheEntryNotFound
    	}
    	return v.v, v.err
    }
    
    // Cache runs an action once per key and caches the result.
    type Cache[K comparable, V any] struct {
    	m sync.Map
    }
    
    type cacheEntry[V any] struct {
    	done   atomic.Bool
    	mu     sync.Mutex
    	result V
    }
    
    // Do calls the function f if and only if Do is being called for the first time with this key.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 15:54:54 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  5. src/crypto/rand/rand_wasip1.go

    // Copyright 2023 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.
    
    //go:build wasip1
    
    package rand
    
    import "syscall"
    
    func init() {
    	Reader = &reader{}
    }
    
    type reader struct{}
    
    func (r *reader) Read(b []byte) (int, error) {
    	// This uses the wasi_snapshot_preview1 random_get syscall defined in
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 11 20:54:07 UTC 2023
    - 787 bytes
    - Viewed (0)
  6. src/crypto/x509/pem_decrypt_test.go

    // Copyright 2012 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 x509
    
    import (
    	"bytes"
    	"crypto/rand"
    	"encoding/base64"
    	"encoding/pem"
    	"strings"
    	"testing"
    )
    
    func TestDecrypt(t *testing.T) {
    	for i, data := range testData {
    		t.Logf("test %v. %v", i, data.kind)
    		block, rest := pem.Decode(data.pemData)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 21 20:03:55 UTC 2019
    - 8.9K bytes
    - Viewed (0)
  7. src/crypto/elliptic/elliptic.go

    		// underlying field is not a whole number of bytes.
    		priv[0] &= mask[bitSize%8]
    		// This is because, in tests, rand will return all zeros and we don't
    		// want to get the point at infinity and loop forever.
    		priv[1] ^= 0x42
    
    		// If the scalar is out of range, sample another random number.
    		if new(big.Int).SetBytes(priv).Cmp(N) >= 0 {
    			continue
    		}
    
    		x, y = curve.ScalarBaseMult(priv)
    	}
    	return
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 13 17:09:47 UTC 2023
    - 9K bytes
    - Viewed (0)
  8. src/crypto/rand/rand_test.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
    
    import (
    	"bytes"
    	"compress/flate"
    	"io"
    	"testing"
    )
    
    func TestRead(t *testing.T) {
    	var n int = 4e6
    	if testing.Short() {
    		n = 1e5
    	}
    	b := make([]byte, n)
    	n, err := io.ReadFull(Reader, b)
    	if n != len(b) || err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 19 20:02:21 UTC 2024
    - 1.2K bytes
    - Viewed (0)
  9. src/test/java/jcifs/tests/BaseCIFSTest.java

    
    /**
     * @author mbechler
     *
     */
    @SuppressWarnings ( "javadoc" )
    public abstract class BaseCIFSTest {
    
        private Map<String, String> properties;
        private CIFSContext context;
        private Random rand = new Random();
        private String name;
    
    
        protected BaseCIFSTest ( String name, Map<String, String> properties ) {
            this.name = name;
            this.properties = properties;
        }
    
    
        /**
    Registered: Wed Jun 12 15:45:55 UTC 2024
    - Last Modified: Sun Jul 01 13:12:10 UTC 2018
    - 8.1K bytes
    - Viewed (0)
  10. src/container/heap/heap_test.go

    // Copyright 2009 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 heap
    
    import (
    	"math/rand"
    	"testing"
    )
    
    type myHeap []int
    
    func (h *myHeap) Less(i, j int) bool {
    	return (*h)[i] < (*h)[j]
    }
    
    func (h *myHeap) Swap(i, j int) {
    	(*h)[i], (*h)[j] = (*h)[j], (*h)[i]
    }
    
    func (h *myHeap) Len() int {
    	return len(*h)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 3.4K bytes
    - Viewed (0)
Back to top