Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 24 for nextBytes (0.18 sec)

  1. android/guava-tests/benchmark/com/google/common/hash/MessageDigestAlgorithmBenchmark.java

      private static final int RANDOM_SEED = new Random().nextInt();
    
      private byte[] testBytes;
    
      @BeforeExperiment
      void setUp() {
        testBytes = new byte[size];
        new Random(RANDOM_SEED).nextBytes(testBytes);
      }
    
      @Benchmark
      byte hashing(int reps) {
        byte result = 0x01;
        HashMethod hashMethod = this.hashMethod;
        Algorithm algorithm = this.algorithm;
        for (int i = 0; i < reps; i++) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 3.5K bytes
    - Viewed (0)
  2. guava-tests/benchmark/com/google/common/primitives/UnsignedBytesBenchmark.java

      @Param({"4", "8", "64", "1024"})
      private int length;
    
      @BeforeExperiment
      void setUp() throws Exception {
        Random r = new Random();
        ba1 = new byte[length];
        r.nextBytes(ba1);
        ba2 = Arrays.copyOf(ba1, ba1.length);
        // Differ at the last element
        ba3 = Arrays.copyOf(ba1, ba1.length);
        ba4 = Arrays.copyOf(ba1, ba1.length);
        ba3[ba1.length - 1] = (byte) 43;
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 2.8K bytes
    - Viewed (0)
  3. guava-tests/benchmark/com/google/common/hash/ChecksumBenchmark.java

      @Param({"10", "1000", "100000", "1000000"})
      private int size;
    
      private byte[] testBytes;
    
      @BeforeExperiment
      void setUp() {
        testBytes = new byte[size];
        new Random(RANDOM_SEED).nextBytes(testBytes);
      }
    
      // CRC32
    
      @Benchmark
      byte crc32HashFunction(int reps) {
        return runHashFunction(reps, Hashing.crc32());
      }
    
      @Benchmark
      byte crc32Checksum(int reps) throws Exception {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Jun 13 16:19:15 GMT 2023
    - 2.9K bytes
    - Viewed (0)
  4. android/guava-tests/benchmark/com/google/common/hash/ChecksumBenchmark.java

      @Param({"10", "1000", "100000", "1000000"})
      private int size;
    
      private byte[] testBytes;
    
      @BeforeExperiment
      void setUp() {
        testBytes = new byte[size];
        new Random(RANDOM_SEED).nextBytes(testBytes);
      }
    
      // CRC32
    
      @Benchmark
      byte crc32HashFunction(int reps) {
        return runHashFunction(reps, Hashing.crc32());
      }
    
      @Benchmark
      byte crc32Checksum(int reps) throws Exception {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Jun 13 16:19:15 GMT 2023
    - 2.9K bytes
    - Viewed (0)
  5. guava-tests/benchmark/com/google/common/hash/MessageDigestAlgorithmBenchmark.java

      private static final int RANDOM_SEED = new Random().nextInt();
    
      private byte[] testBytes;
    
      @BeforeExperiment
      void setUp() {
        testBytes = new byte[size];
        new Random(RANDOM_SEED).nextBytes(testBytes);
      }
    
      @Benchmark
      byte hashing(int reps) {
        byte result = 0x01;
        HashMethod hashMethod = this.hashMethod;
        Algorithm algorithm = this.algorithm;
        for (int i = 0; i < reps; i++) {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 3.5K bytes
    - Viewed (0)
  6. samples/slack/src/main/java/okhttp3/slack/OAuthSessionFactory.java

          listeners.put(state, listener);
        }
    
        return slackApi.authorizeUrl(scopes, redirectUrl(), state, team);
      }
    
      private ByteString randomToken() {
        byte[] bytes = new byte[16];
        secureRandom.nextBytes(bytes);
        return ByteString.of(bytes);
      }
    
      private HttpUrl redirectUrl() {
        return mockWebServer.url("/oauth/");
      }
    
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Aug 12 07:26:27 GMT 2021
    - 3.8K bytes
    - Viewed (0)
  7. guava-tests/benchmark/com/google/common/hash/HashCodeBenchmark.java

        abstract boolean doEquals(byte[] a, byte[] b);
      }
    
      private byte[] testBytesA;
      private byte[] testBytesB;
    
      @BeforeExperiment
      void setUp() {
        testBytesA = new byte[size];
        random.nextBytes(testBytesA);
        testBytesB = Arrays.copyOf(testBytesA, size);
        int indexToDifferAt = -1;
        switch (whereToDiffer) {
          case ONE_PERCENT_IN:
            indexToDifferAt = (int) (size * 0.01);
            break;
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 3.9K bytes
    - Viewed (0)
  8. android/guava-tests/benchmark/com/google/common/hash/HashCodeBenchmark.java

        abstract boolean doEquals(byte[] a, byte[] b);
      }
    
      private byte[] testBytesA;
      private byte[] testBytesB;
    
      @BeforeExperiment
      void setUp() {
        testBytesA = new byte[size];
        random.nextBytes(testBytesA);
        testBytesB = Arrays.copyOf(testBytesA, size);
        int indexToDifferAt = -1;
        switch (whereToDiffer) {
          case ONE_PERCENT_IN:
            indexToDifferAt = (int) (size * 0.01);
            break;
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 3.9K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/internal/cache2/FileOperatorTest.kt

        assertFailsWith<IndexOutOfBoundsException> {
          operator.write(0, buffer, 4L)
        }
      }
    
      private fun randomByteString(byteCount: Int): ByteString {
        val bytes = ByteArray(byteCount)
        Random(0).nextBytes(bytes)
        return ByteString.of(*bytes)
      }
    
      private fun snapshot(): ByteString {
        randomAccessFile!!.getChannel().force(false)
        val source = file!!.source().buffer()
        return source.readByteString()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.8K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/internal/ws/WebSocketWriterTest.kt

        assertThat(actual).isEqualTo(expected)
      }
    
      companion object {
        private fun binaryData(length: Int): ByteString {
          val junk = ByteArray(length)
          Random(0).nextBytes(junk)
          return junk.toByteString()
        }
      }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.3K bytes
    - Viewed (0)
Back to top