Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 40 for HashFunction (0.14 sec)

  1. android/guava/src/com/google/common/hash/HashFunction.java

     * @since 11.0
     */
    @Immutable
    @ElementTypesAreNonnullByDefault
    public interface HashFunction {
      /**
       * Begins a new hash code computation by returning an initialized, stateful {@code Hasher}
       * instance that is ready to receive data. Example:
       *
       * <pre>{@code
       * HashFunction hf = Hashing.md5();
       * HashCode hc = hf.newHasher()
       *     .putLong(id)
       *     .putBoolean(isActive)
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue May 25 18:22:59 UTC 2021
    - 10.9K bytes
    - Viewed (0)
  2. guava/src/com/google/common/hash/HashFunction.java

     * @since 11.0
     */
    @Immutable
    @ElementTypesAreNonnullByDefault
    public interface HashFunction {
      /**
       * Begins a new hash code computation by returning an initialized, stateful {@code Hasher}
       * instance that is ready to receive data. Example:
       *
       * <pre>{@code
       * HashFunction hf = Hashing.md5();
       * HashCode hc = hf.newHasher()
       *     .putLong(id)
       *     .putBoolean(isActive)
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue May 25 18:22:59 UTC 2021
    - 10.9K bytes
    - Viewed (0)
  3. android/guava-tests/benchmark/com/google/common/hash/HashFunctionBenchmark.java

      }
    
      @Benchmark
      int hasher(int reps) {
        HashFunction hashFunction = hashFunctionEnum.getHashFunction();
        int result = 37;
        for (int i = 0; i < reps; i++) {
          result ^= hashFunction.newHasher().putBytes(testBytes).hash().asBytes()[0];
        }
        return result;
      }
    
      @Benchmark
      int hashFunction(int reps) {
        HashFunction hashFunction = hashFunctionEnum.getHashFunction();
        int result = 37;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Dec 04 17:37:03 UTC 2017
    - 2.3K bytes
    - Viewed (0)
  4. android/guava-tests/benchmark/com/google/common/hash/ChecksumBenchmark.java

          result = (byte) (result ^ checksum.asLong());
        }
        return result;
      }
    
      // Helpers + main
    
      private byte runHashFunction(int reps, HashFunction hashFunction) {
        byte result = 0x01;
        // Trick the JVM to prevent it from using the hash function non-polymorphically
        result ^= Hashing.crc32().hashInt(reps).asBytes()[0];
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 16 16:53:43 UTC 2024
    - 3.4K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/hash/Hashing.java

       *
       * @since 19.0
       */
      public static HashFunction concatenating(Iterable<HashFunction> hashFunctions) {
        checkNotNull(hashFunctions);
        // We can't use Iterables.toArray() here because there's no hash->collect dependency
        List<HashFunction> list = new ArrayList<>();
        for (HashFunction hashFunction : hashFunctions) {
          list.add(hashFunction);
        }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Jul 19 16:02:36 UTC 2024
    - 29.3K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/hash/HashingTest.java

          if (shouldHaveKnownHashes(method)) {
            HashFunction hashFunction = (HashFunction) method.invoke(Hashing.class);
            assertTrue(
                "There should be at least 3 entries in KNOWN_HASHES for " + hashFunction,
                KNOWN_HASHES.row(hashFunction).size() >= 3);
          }
        }
      }
    
      public void testKnownUtf8Hashing() {
        for (Cell<HashFunction, String, String> cell : KNOWN_HASHES.cellSet()) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Jul 09 17:40:09 UTC 2024
    - 26.3K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/hash/HashTestUtils.java

        assertHashByteBufferMatchesBytes(hashFunction);
        assertHashByteBufferExhaustsBuffer(hashFunction);
        assertHashByteBufferPreservesByteOrder(hashFunction);
        assertHasherByteBufferPreservesByteOrder(hashFunction);
      }
    
      static void assertHashByteBufferMatchesBytes(HashFunction hashFunction) {
        Random rng = new Random(0L);
        byte[] bytes = new byte[rng.nextInt(256) + 1];
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Jul 23 14:22:54 UTC 2024
    - 25.5K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/hash/HashingOutputStreamTest.java

      private Hasher hasher;
      private HashFunction hashFunction;
      private final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
    
      @SuppressWarnings("DoNotMock")
      @Override
      protected void setUp() throws Exception {
        super.setUp();
        hasher = mock(Hasher.class);
        hashFunction = mock(HashFunction.class);
    
        when(hashFunction.newHasher()).thenReturn(hasher);
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 11 22:00:03 UTC 2024
    - 3.1K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/hash/HashingInputStreamTest.java

      private Hasher hasher;
      private HashFunction hashFunction;
      private static final byte[] testBytes = new byte[] {'y', 'a', 'm', 's'};
      private ByteArrayInputStream buffer;
    
      @SuppressWarnings("DoNotMock")
      @Override
      protected void setUp() throws Exception {
        super.setUp();
        hasher = mock(Hasher.class);
        hashFunction = mock(HashFunction.class);
        buffer = new ByteArrayInputStream(testBytes);
    
    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

      private Hasher hasher;
      private HashFunction hashFunction;
      private static final byte[] testBytes = new byte[] {'y', 'a', 'm', 's'};
      private ByteArrayInputStream buffer;
    
      @SuppressWarnings("DoNotMock")
      @Override
      protected void setUp() throws Exception {
        super.setUp();
        hasher = mock(Hasher.class);
        hashFunction = mock(HashFunction.class);
        buffer = new ByteArrayInputStream(testBytes);
    
    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