- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 159 for random (0.14 sec)
-
guava-tests/test/com/google/common/hash/HashTestUtils.java
assertHashLongEquivalence(hashFunction, random); assertHashStringEquivalence(hashFunction, random); assertHashStringWithSurrogatesEquivalence(hashFunction, random); } } private static void assertHashBytesEquivalence(HashFunction hashFunction, Random random) { int size = random.nextInt(2048); byte[] bytes = new byte[size]; random.nextBytes(bytes);
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Tue Jul 23 14:22:54 UTC 2024 - 25.5K bytes - Viewed (0) -
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) {
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Fri Jul 12 20:51:54 UTC 2024 - 6.7K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/collect/MinMaxPriorityQueueTest.java
long seed = new Random().nextLong(); Random random = new Random(seed); insertRandomly(elements, q, random); return seed; } private static void insertRandomly( ArrayList<Integer> elements, MinMaxPriorityQueue<Integer> q, Random random) { while (!elements.isEmpty()) { int selectedIndex = random.nextInt(elements.size());
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 30 16:15:19 UTC 2024 - 35.9K bytes - Viewed (0) -
guava-tests/test/com/google/common/hash/AbstractStreamingHasherTest.java
sink.assertBytes(new byte[] {1, 2, 0, 0}); // padded with zeros } public void testString() { Random random = new Random(); for (int i = 0; i < 100; i++) { byte[] bytes = new byte[64]; random.nextBytes(bytes); String s = new String(bytes, UTF_16LE); // so all random strings are valid assertEquals( new Sink(4).putUnencodedChars(s).hash(),
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Tue Jul 23 14:22:54 UTC 2024 - 8.5K bytes - Viewed (0) -
guava-tests/test/com/google/common/collect/CollectionBenchmarkSampleData.java
private final SpecialRandom random; private final double hitRate; private final int size; private final Set<Element> valuesInSet; private final Element[] queries; CollectionBenchmarkSampleData(int size) { this(true, new SpecialRandom(), 1.0, size); } CollectionBenchmarkSampleData( boolean isUserTypeFast, SpecialRandom random, double hitRate, int size) {
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 30 16:15:19 UTC 2024 - 4.1K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/hash/AbstractByteHasherTest.java
hasher.putChar((char) 0x0201); hasher.assertBytes(new byte[] {1, 2}); } public void testString() { Random random = new Random(); for (int i = 0; i < 100; i++) { byte[] bytes = new byte[64]; random.nextBytes(bytes); String s = new String(bytes, UTF_16LE); // so all random strings are valid assertEquals( new TestHasher().putUnencodedChars(s).hash(),
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Tue Jul 23 14:22:54 UTC 2024 - 3.8K bytes - Viewed (0) -
guava-tests/test/com/google/common/hash/BloomFilterTest.java
assertTrue(BloomFilter.optimalNumOfBits(n, fpp) >= 0); } } // some random values Random random = new Random(0); for (int repeats = 0; repeats < 10000; repeats++) { assertTrue(BloomFilter.optimalNumOfBits(random.nextInt(1 << 16), random.nextDouble()) >= 0); } // and some crazy values (this used to be capped to Integer.MAX_VALUE, now it can go bigger
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Oct 21 14:28:19 UTC 2024 - 21.2K bytes - Viewed (0) -
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 {
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Tue May 28 17:14:16 UTC 2024 - 12K bytes - Viewed (0) -
guava-tests/test/com/google/common/collect/ConcurrentHashMultisetBasherTest.java
} } private static class MutateTask implements Callable<int[]> { private final ConcurrentHashMultiset<String> multiset; private final ImmutableList<String> keys; private final Random random = new Random(); private MutateTask(ConcurrentHashMultiset<String> multiset, ImmutableList<String> keys) { this.multiset = multiset; this.keys = keys; } @Override
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 30 16:15:19 UTC 2024 - 5.9K bytes - Viewed (0) -
guava-tests/test/com/google/common/collect/MinMaxPriorityQueueTest.java
long seed = new Random().nextLong(); Random random = new Random(seed); insertRandomly(elements, q, random); return seed; } private static void insertRandomly( ArrayList<Integer> elements, MinMaxPriorityQueue<Integer> q, Random random) { while (!elements.isEmpty()) { int selectedIndex = random.nextInt(elements.size());
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 30 16:15:19 UTC 2024 - 35.9K bytes - Viewed (0)