- Sort Score
- Result 10 results
- Languages All
Results 31 - 40 of 332 for Random (0.05 sec)
-
guava-tests/benchmark/com/google/common/base/WhitespaceMatcherBenchmark.java
return new String(result); } private static String newTestString(Random random, BitSet bitSet, int percentMatching) { final String allMatchingChars = allMatchingChars(bitSet); final char[] result = new char[STRING_LENGTH]; // Fill with matching chars. for (int i = 0; i < result.length; i++) { result[i] = allMatchingChars.charAt(random.nextInt(allMatchingChars.length())); }
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed May 16 22:49:59 UTC 2018 - 3.9K bytes - Viewed (0) -
guava-tests/test/com/google/common/hash/HashingTest.java
} public void testCombineOrdered_randomHashCodes() { Random random = new Random(7); List<HashCode> hashCodes = Lists.newArrayList(); for (int i = 0; i < 10; i++) { hashCodes.add(HashCode.fromLong(random.nextLong())); } HashCode hashCode1 = Hashing.combineOrdered(hashCodes); Collections.shuffle(hashCodes, random); HashCode hashCode2 = Hashing.combineOrdered(hashCodes);
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Tue Jul 09 17:40:09 UTC 2024 - 26.3K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/internal/ws/WebSocketWriterTest.kt
private val serverWriter = WebSocketWriter( isClient = false, sink = data, random = random, perMessageDeflate = false, noContextTakeover = false, minimumDeflateSize = 0L, ) private val clientWriter = WebSocketWriter( isClient = true, sink = data, random = random, perMessageDeflate = false, noContextTakeover = false, minimumDeflateSize = 0L,
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 9.3K bytes - Viewed (0) -
guava-tests/benchmark/com/google/common/math/LessThanBenchmark.java
@BeforeExperiment void setUp() { Random random = new Random(randomSeed); xInts = new int[SAMPLE_SIZE]; yInts = new int[SAMPLE_SIZE]; xLongs = new long[SAMPLE_SIZE]; yLongs = new long[SAMPLE_SIZE]; constant = new int[SAMPLE_SIZE]; for (int i = 0; i < SAMPLE_SIZE; i++) { xInts[i] = random.nextInt(Integer.MAX_VALUE); yInts[i] = random.nextInt(Integer.MAX_VALUE);
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 4K bytes - Viewed (0) -
android/guava-tests/benchmark/com/google/common/io/CharStreamsCopyBenchmark.java
public void setUp() { // precalculate some random strings of ascii characters. StringBuilder sb = new StringBuilder(); Random random = new Random(0xdeadbeef); // for unpredictable but reproducible behavior sb.ensureCapacity(size); for (int k = 0; k < size; k++) { // [9-127) includes all ascii non-control characters sb.append((char) (random.nextInt(127 - 9) + 9)); } data = sb.toString(); }
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Thu Feb 23 18:59:54 UTC 2023 - 3.2K bytes - Viewed (0) -
guava-tests/benchmark/com/google/common/io/CharStreamsCopyBenchmark.java
public void setUp() { // precalculate some random strings of ascii characters. StringBuilder sb = new StringBuilder(); Random random = new Random(0xdeadbeef); // for unpredictable but reproducible behavior sb.ensureCapacity(size); for (int k = 0; k < size; k++) { // [9-127) includes all ascii non-control characters sb.append((char) (random.nextInt(127 - 9) + 9)); } data = sb.toString(); }
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Thu Feb 23 18:59:54 UTC 2023 - 3.2K bytes - Viewed (0) -
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 logger.CriticalIf(context.Background(), errors.New("crypto: invalid key length"))
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Tue Mar 19 20:28:10 UTC 2024 - 6.4K bytes - Viewed (0) -
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) -
android/guava-tests/benchmark/com/google/common/hash/HashFunctionBenchmark.java
// Use a statically configured random instance for all of the benchmarks private static final Random random = new Random(42); @Param({"10", "1000", "100000", "1000000"}) private int size; @Param HashFunctionEnum hashFunctionEnum; private byte[] testBytes; @BeforeExperiment void setUp() { testBytes = new byte[size]; random.nextBytes(testBytes); } @Benchmark
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 2.3K bytes - Viewed (0) -
guava-tests/benchmark/com/google/common/collect/SortedCopyBenchmark.java
} } }, RANDOM { @Override void arrange(List<Integer> list) {} }; abstract void arrange(List<Integer> list); } private ImmutableList<Integer> input; @BeforeExperiment void setUp() { checkArgument(size > 0, "empty collection not supported"); Set<Integer> set = new LinkedHashSet<>(size); Random random = new Random();
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 30 16:15:19 UTC 2024 - 3.5K bytes - Viewed (0)