Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for nextBytes (0.19 sec)

  1. okhttp/src/main/kotlin/okhttp3/internal/ws/WebSocketWriter.kt

        }
    
        val b0 = B0_FLAG_FIN or opcode
        sinkBuffer.writeByte(b0)
    
        var b1 = length
        if (isClient) {
          b1 = b1 or B1_FLAG_MASK
          sinkBuffer.writeByte(b1)
    
          random.nextBytes(maskKey!!)
          sinkBuffer.write(maskKey)
    
          if (length > 0) {
            val payloadStart = sinkBuffer.size
            sinkBuffer.write(payload)
    
            sinkBuffer.readAndWriteUnsafe(maskCursor!!)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.9K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/internal/http2/HuffmanTest.kt

        for (i in s.indices) {
          assertRoundTrip(s.substring(0, i).encodeUtf8())
        }
        val random = Random(123456789L)
        val buf = ByteArray(4096)
        random.nextBytes(buf)
        assertRoundTrip(buf.toByteString())
      }
    
      private fun assertRoundTrip(data: ByteString) {
        val encodeBuffer = Buffer()
        encode(data, encodeBuffer)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Jan 04 05:32:07 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/hash/AbstractByteHasherTest.java

        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(),
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 3.8K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/hash/AbstractByteHasherTest.java

        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(),
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 3.8K bytes
    - Viewed (0)
  5. 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)
  6. 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)
  7. 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)
  8. 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)
  9. guava-tests/test/com/google/common/hash/AbstractStreamingHasherTest.java

      }
    
      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(),
              new Sink(4).putBytes(s.getBytes(UTF_16LE)).hash());
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 8.5K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/hash/AbstractStreamingHasherTest.java

      }
    
      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(),
              new Sink(4).putBytes(s.getBytes(UTF_16LE)).hash());
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 8.5K bytes
    - Viewed (0)
Back to top