Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 39 for hashBytes (0.1 sec)

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

        for (int i = 0; i < reps; i++) {
          result ^= hashFunction.hashBytes(testBytes).asBytes()[0];
        }
        return result;
      }
    
      @Benchmark
      int hashFunctionWithOffset(int reps) {
        HashFunction hashFunction = hashFunctionEnum.getHashFunction();
        int result = 37;
        for (int i = 0; i < reps; i++) {
          result ^= hashFunction.hashBytes(testBytes, 1, testBytes.length - 1).asBytes()[0];
        }
        return result;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Dec 04 17:37:03 UTC 2017
    - 2.3K bytes
    - Viewed (0)
  2. guava/src/com/google/common/hash/AbstractNonStreamingHashFunction.java

          buffer.putChar(input.charAt(i));
        }
        return hashBytes(buffer.array());
      }
    
      @Override
      public HashCode hashString(CharSequence input, Charset charset) {
        return hashBytes(input.toString().getBytes(charset));
      }
    
      @Override
      public abstract HashCode hashBytes(byte[] input, int off, int len);
    
      @Override
      public HashCode hashBytes(ByteBuffer input) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Apr 20 18:43:59 UTC 2021
    - 3.8K bytes
    - Viewed (0)
  3. android/guava-tests/benchmark/com/google/common/hash/ChecksumBenchmark.java

      }
    
      @Benchmark
      byte fingerprintChecksum(int reps) throws Exception {
        byte result = 0x01;
        for (int i = 0; i < reps; i++) {
          HashCode checksum = new Fingerprint2011().hashBytes(testBytes, 0, testBytes.length);
          result = (byte) (result ^ checksum.asLong());
        }
        return result;
      }
    
      // Helpers + main
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 16 16:53:43 UTC 2024
    - 3.4K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/hash/Murmur3Hash32Test.java

        assertHash(expected, murmur3_32_fixed().newHasher().putString(string, charset).hash());
        assertHash(expected, murmur3_32().hashBytes(string.getBytes(charset)));
        assertHash(expected, murmur3_32_fixed().hashBytes(string.getBytes(charset)));
        assertHash(expected, murmur3_32().newHasher().putBytes(string.getBytes(charset)).hash());
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:29:46 UTC 2024
    - 8.3K bytes
    - Viewed (0)
  5. cmd/bitrot-streaming.go

    	byteBuf      []byte
    }
    
    func (b *streamingBitrotWriter) Write(p []byte) (int, error) {
    	if len(p) == 0 {
    		return 0, nil
    	}
    	b.h.Reset()
    	b.h.Write(p)
    	hashBytes := b.h.Sum(nil)
    	_, err := b.iow.Write(hashBytes)
    	if err != nil {
    		b.closeWithErr(err)
    		return 0, err
    	}
    	n, err := b.iow.Write(p)
    	if err != nil {
    		b.closeWithErr(err)
    		return n, err
    	}
    	if n != len(p) {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Wed Aug 21 12:20:54 UTC 2024
    - 6K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/hash/SipHashFunctionTest.java

        ImmutableSet<HashCode> hashCodes =
            ImmutableSet.of(
                SIP_WITH_KEY.hashBytes(col1),
                SIP_WITH_KEY.hashBytes(col2),
                SIP_WITH_KEY.hashBytes(col3));
        assertEquals(3, hashCodes.size());
      }
    
      public void testToString() {
        assertEquals("Hashing.sipHash24(" + K0 + ", " + K1 + ")", SIP_WITH_KEY.toString());
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Jul 23 14:22:54 UTC 2024
    - 6.6K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/hash/SipHashFunctionTest.java

        ImmutableSet<HashCode> hashCodes =
            ImmutableSet.of(
                SIP_WITH_KEY.hashBytes(col1),
                SIP_WITH_KEY.hashBytes(col2),
                SIP_WITH_KEY.hashBytes(col3));
        assertEquals(3, hashCodes.size());
      }
    
      public void testToString() {
        assertEquals("Hashing.sipHash24(" + K0 + ", " + K1 + ")", SIP_WITH_KEY.toString());
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Jul 23 14:22:54 UTC 2024
    - 6.6K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/hash/HashTestUtils.java

        assertEquals(hashFunction.hashBytes(bytes), hashFunction.hashBytes(ByteBuffer.wrap(bytes)));
      }
    
      static void assertHashByteBufferExhaustsBuffer(HashFunction hashFunction) {
        Random rng = new Random(0L);
        byte[] bytes = new byte[rng.nextInt(256) + 1];
        rng.nextBytes(bytes);
        ByteBuffer buffer = ByteBuffer.wrap(bytes);
        HashCode unused = hashFunction.hashBytes(buffer);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Jul 23 14:22:54 UTC 2024
    - 25.5K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/hash/HashingInputStreamTest.java

        verify(hashFunction).newHasher();
        verifyNoMoreInteractions(hashFunction, hasher);
      }
    
      public void testHash_hashesCorrectly() throws Exception {
        HashCode expectedHash = Hashing.md5().hashBytes(testBytes);
        HashingInputStream in = new HashingInputStream(Hashing.md5(), buffer);
    
        byte[] buf = new byte[4];
        int numOfByteRead = in.read(buf, 0, buf.length);
        assertEquals(4, numOfByteRead);
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 02 16:24:50 UTC 2020
    - 5K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/hash/HashingInputStreamTest.java

        verify(hashFunction).newHasher();
        verifyNoMoreInteractions(hashFunction, hasher);
      }
    
      public void testHash_hashesCorrectly() throws Exception {
        HashCode expectedHash = Hashing.md5().hashBytes(testBytes);
        HashingInputStream in = new HashingInputStream(Hashing.md5(), buffer);
    
        byte[] buf = new byte[4];
        int numOfByteRead = in.read(buf, 0, buf.length);
        assertEquals(4, numOfByteRead);
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 02 16:24:50 UTC 2020
    - 5K bytes
    - Viewed (0)
Back to top