Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 76 for hashInt (0.26 sec)

  1. android/guava-tests/test/com/google/common/hash/Murmur3Hash32Test.java

      public void testKnownIntegerInputs() {
        assertHash(593689054, murmur3_32().hashInt(0));
        assertHash(-189366624, murmur3_32().hashInt(-42));
        assertHash(-1134849565, murmur3_32().hashInt(42));
        assertHash(-1718298732, murmur3_32().hashInt(Integer.MIN_VALUE));
        assertHash(-1653689534, murmur3_32().hashInt(Integer.MAX_VALUE));
      }
    
      public void testKnownLongInputs() {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 08 13:56:22 GMT 2021
    - 8.6K bytes
    - Viewed (0)
  2. guava-tests/benchmark/com/google/common/hash/ChecksumBenchmark.java

        byte result = 0x01;
        // Trick the JVM to prevent it from using the hash function non-polymorphically
        result ^= Hashing.crc32().hashInt(reps).asBytes()[0];
        result ^= Hashing.adler32().hashInt(reps).asBytes()[0];
        for (int i = 0; i < reps; i++) {
          result ^= hashFunction.hashBytes(testBytes).asBytes()[0];
        }
        return result;
      }
    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)
  3. android/guava-tests/benchmark/com/google/common/hash/ChecksumBenchmark.java

        byte result = 0x01;
        // Trick the JVM to prevent it from using the hash function non-polymorphically
        result ^= Hashing.crc32().hashInt(reps).asBytes()[0];
        result ^= Hashing.adler32().hashInt(reps).asBytes()[0];
        for (int i = 0; i < reps; i++) {
          result ^= hashFunction.hashBytes(testBytes).asBytes()[0];
        }
        return result;
      }
    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)
  4. android/guava/src/com/google/common/hash/AbstractNonStreamingHashFunction.java

      @Override
      public Hasher newHasher(int expectedInputSize) {
        Preconditions.checkArgument(expectedInputSize >= 0);
        return new BufferingHasher(expectedInputSize);
      }
    
      @Override
      public HashCode hashInt(int input) {
        return hashBytes(ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN).putInt(input).array());
      }
    
      @Override
      public HashCode hashLong(long input) {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Apr 20 18:43:59 GMT 2021
    - 3.8K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/hash/Murmur3Hash32Test.java

      public void testKnownIntegerInputs() {
        assertHash(593689054, murmur3_32().hashInt(0));
        assertHash(-189366624, murmur3_32().hashInt(-42));
        assertHash(-1134849565, murmur3_32().hashInt(42));
        assertHash(-1718298732, murmur3_32().hashInt(Integer.MIN_VALUE));
        assertHash(-1653689534, murmur3_32().hashInt(Integer.MAX_VALUE));
      }
    
      public void testKnownLongInputs() {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 08 13:56:22 GMT 2021
    - 8.6K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/hash/AbstractHashFunction.java

      }
    
      @Override
      public HashCode hashString(CharSequence input, Charset charset) {
        return newHasher().putString(input, charset).hash();
      }
    
      @Override
      public HashCode hashInt(int input) {
        return newHasher(4).putInt(input).hash();
      }
    
      @Override
      public HashCode hashLong(long input) {
        return newHasher(8).putLong(input).hash();
      }
    
      @Override
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Apr 20 18:43:59 GMT 2021
    - 2.5K bytes
    - Viewed (0)
  7. guava-tests/benchmark/com/google/common/hash/MessageDigestAlgorithmBenchmark.java

      }
    
      private enum Algorithm {
        MD5("MD5", Hashing.md5()),
        SHA_1("SHA-1", Hashing.sha1()),
        SHA_256("SHA-256", Hashing.sha256()),
        SHA_384("SHA-384", Hashing.sha384()),
        SHA_512("SHA-512", Hashing.sha512());
    
        private final String algorithmName;
        private final HashFunction hashFn;
    
        Algorithm(String algorithmName, HashFunction hashFn) {
          this.algorithmName = algorithmName;
    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)
  8. guava-tests/test/com/google/common/hash/ChecksumHashFunctionTest.java

     * the License.
     */
    
    package com.google.common.hash;
    
    import static com.google.common.hash.Hashing.ChecksumType.ADLER_32;
    import static com.google.common.hash.Hashing.ChecksumType.CRC_32;
    
    import java.util.zip.Checksum;
    import junit.framework.TestCase;
    
    /**
     * Tests for ChecksumHashFunction.
     *
     * @author Colin Decker
     */
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Jan 30 14:33:12 GMT 2018
    - 3.1K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/io/ByteSourceTester.java

                  }
                });
    
        assertExpectedBytes(readBytes);
      }
    
      public void testHash() throws IOException {
        HashCode expectedHash = Hashing.md5().hashBytes(expected);
        assertEquals(expectedHash, source.hash(Hashing.md5()));
      }
    
      public void testSlice_illegalArguments() {
        assertThrows(
            "expected IllegalArgumentException for call to slice with offset -1: " + source,
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 8.6K bytes
    - Viewed (0)
  10. android/guava-testlib/src/com/google/common/collect/testing/SetTestSuiteBuilder.java

    import com.google.common.collect.testing.testers.SetRemoveTester;
    import com.google.common.testing.SerializableTester;
    import java.util.ArrayList;
    import java.util.Collection;
    import java.util.HashSet;
    import java.util.List;
    import java.util.Set;
    import junit.framework.TestSuite;
    
    /**
     * Creates, based on your criteria, a JUnit test suite that exhaustively tests a Set implementation.
     *
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Feb 26 19:46:10 GMT 2024
    - 4.6K bytes
    - Viewed (0)
Back to top