/external/guava/android/guava-tests/test/com/google/common/hash/ |
D | HashCodeTest.java | 82 HashCode fromInt = HashCode.fromInt(expected.asInt); in testFromInt() 92 HashCode fromLong = HashCode.fromLong(expected.asLong); in testFromLong() 100 HashCode fromBytes = HashCode.fromBytes(expected.bytes); in testFromBytes() 107 HashCode hashCode = HashCode.fromBytes(bytes); in testFromBytes_copyOccurs() 122 HashCode hashCode = HashCode.fromBytesNoCopy(bytes); in testFromBytesNoCopy_noCopyOccurs() 135 HashCode hashCode = HashCode.fromBytes(bytes); in testGetBytesInternal_noCloneOccurs() 147 assertEquals(0x1111111111111111L, HashCode.fromLong(0x1111111111111111L).padToLong()); in testPadToLong() 148 assertEquals(0x9999999999999999L, HashCode.fromLong(0x9999999999999999L).padToLong()); in testPadToLong() 149 assertEquals(0x0000000011111111L, HashCode.fromInt(0x11111111).padToLong()); in testPadToLong() 150 assertEquals(0x0000000099999999L, HashCode.fromInt(0x99999999).padToLong()); in testPadToLong() [all …]
|
D | HashingTest.java | 228 checkSameResult(HashCode.fromLong(1), 1); in testConsistentHash_ofHashCode() 229 checkSameResult(HashCode.fromLong(0x9999999999999999L), 0x9999999999999999L); in testConsistentHash_ofHashCode() 230 checkSameResult(HashCode.fromInt(0x99999999), 0x0000000099999999L); in testConsistentHash_ofHashCode() 233 public void checkSameResult(HashCode hashCode, long equivLong) { in checkSameResult() 263 () -> Hashing.combineOrdered(Collections.<HashCode>emptySet())); in testCombineOrdered_empty() 270 HashCode unused = in testCombineOrdered_differentBitLengths() 272 ImmutableList.of(HashCode.fromInt(32), HashCode.fromLong(32L))); in testCombineOrdered_differentBitLengths() 277 HashCode hash31 = HashCode.fromInt(31); in testCombineOrdered() 278 HashCode hash32 = HashCode.fromInt(32); in testCombineOrdered() 281 HashCode.fromBytes(new byte[] {(byte) 0x80, 0, 0, 0}), in testCombineOrdered() [all …]
|
D | AbstractStreamingHasherTest.java | 48 HashCode unused = sink.hash(); in testBytes() 56 HashCode unused = sink.hash(); in testShort() 64 HashCode unused = sink.hash(); in testInt() 72 HashCode unused = sink.hash(); in testLong() 80 HashCode unused = sink.hash(); in testChar() 102 HashCode unused = sink.hash(); in testFloat() 110 HashCode unused = sink.hash(); in testDouble() 158 HashCode unused = sink.hash(); in testExhaustive() 190 protected HashCode makeHash() { in makeHash() 191 return HashCode.fromBytes(out.toByteArray()); in makeHash() [all …]
|
D | AbstractNonStreamingHashFunctionTest.java | 45 HashCode[] codes = new HashCode[hashers.size()]; in testExhaustive() 106 protected HashCode makeHash() { in newHasher() 107 return HashCode.fromBytes(out.toByteArray()); in newHasher() 134 public HashCode hashBytes(byte[] input, int off, int len) { in hashBytes() 135 return HashCode.fromBytes(Arrays.copyOfRange(input, off, off + len)); in hashBytes()
|
D | Murmur3Hash128Test.java | 42 HashCode foxHash = in testKnownValues() 48 HashCode expected = toHashCode(expected1, expected2); in assertHash() 55 private static HashCode toHashCode(long... longs) { in toHashCode() 60 return HashCode.fromBytes(bb.array()); in toHashCode()
|
D | MacHashFunctionTest.java | 102 HashCode.fromBytes(mac.doFinal()), in testMultipleUpdates() 117 HashCode.fromBytes(mac.doFinal("!!!".getBytes(UTF_8))), in testMultipleUpdatesDoFinal() 183 assertEquals(knownOutput, HashCode.fromBytes(mac.doFinal()).toString()); in testEmptyInputs() 192 assertEquals(knownOutput, HashCode.fromBytes(mac.doFinal()).toString()); in testEmptyInputs_mixedAlgorithms() 203 assertEquals(knownOutput, HashCode.fromBytes(mac.doFinal()).toString()); in testKnownInputs() 204 assertEquals(knownOutput, HashCode.fromBytes(mac.doFinal(input.getBytes(UTF_8))).toString()); in testKnownInputs() 216 assertEquals(knownOutput, HashCode.fromBytes(mac.doFinal()).toString()); in testKnownInputs_mixedAlgorithms() 217 assertEquals(knownOutput, HashCode.fromBytes(mac.doFinal(input.getBytes(UTF_8))).toString()); in testKnownInputs_mixedAlgorithms() 277 assertEquals(HashCode.fromBytes(mac.doFinal()), hashFunc.hashBytes(input)); in assertMacHashing() 278 assertEquals(HashCode.fromBytes(mac.doFinal(input)), hashFunc.hashBytes(input)); in assertMacHashing() [all …]
|
/external/guava/guava-tests/test/com/google/common/hash/ |
D | HashCodeTest.java | 82 HashCode fromInt = HashCode.fromInt(expected.asInt); in testFromInt() 92 HashCode fromLong = HashCode.fromLong(expected.asLong); in testFromLong() 100 HashCode fromBytes = HashCode.fromBytes(expected.bytes); in testFromBytes() 107 HashCode hashCode = HashCode.fromBytes(bytes); in testFromBytes_copyOccurs() 122 HashCode hashCode = HashCode.fromBytesNoCopy(bytes); in testFromBytesNoCopy_noCopyOccurs() 135 HashCode hashCode = HashCode.fromBytes(bytes); in testGetBytesInternal_noCloneOccurs() 147 assertEquals(0x1111111111111111L, HashCode.fromLong(0x1111111111111111L).padToLong()); in testPadToLong() 148 assertEquals(0x9999999999999999L, HashCode.fromLong(0x9999999999999999L).padToLong()); in testPadToLong() 149 assertEquals(0x0000000011111111L, HashCode.fromInt(0x11111111).padToLong()); in testPadToLong() 150 assertEquals(0x0000000099999999L, HashCode.fromInt(0x99999999).padToLong()); in testPadToLong() [all …]
|
D | HashingTest.java | 228 checkSameResult(HashCode.fromLong(1), 1); in testConsistentHash_ofHashCode() 229 checkSameResult(HashCode.fromLong(0x9999999999999999L), 0x9999999999999999L); in testConsistentHash_ofHashCode() 230 checkSameResult(HashCode.fromInt(0x99999999), 0x0000000099999999L); in testConsistentHash_ofHashCode() 233 public void checkSameResult(HashCode hashCode, long equivLong) { in checkSameResult() 263 () -> Hashing.combineOrdered(Collections.<HashCode>emptySet())); in testCombineOrdered_empty() 270 HashCode unused = in testCombineOrdered_differentBitLengths() 272 ImmutableList.of(HashCode.fromInt(32), HashCode.fromLong(32L))); in testCombineOrdered_differentBitLengths() 277 HashCode hash31 = HashCode.fromInt(31); in testCombineOrdered() 278 HashCode hash32 = HashCode.fromInt(32); in testCombineOrdered() 281 HashCode.fromBytes(new byte[] {(byte) 0x80, 0, 0, 0}), in testCombineOrdered() [all …]
|
D | AbstractStreamingHasherTest.java | 48 HashCode unused = sink.hash(); in testBytes() 56 HashCode unused = sink.hash(); in testShort() 64 HashCode unused = sink.hash(); in testInt() 72 HashCode unused = sink.hash(); in testLong() 80 HashCode unused = sink.hash(); in testChar() 102 HashCode unused = sink.hash(); in testFloat() 110 HashCode unused = sink.hash(); in testDouble() 158 HashCode unused = sink.hash(); in testExhaustive() 190 protected HashCode makeHash() { in makeHash() 191 return HashCode.fromBytes(out.toByteArray()); in makeHash() [all …]
|
D | AbstractNonStreamingHashFunctionTest.java | 45 HashCode[] codes = new HashCode[hashers.size()]; in testExhaustive() 106 protected HashCode makeHash() { in newHasher() 107 return HashCode.fromBytes(out.toByteArray()); in newHasher() 134 public HashCode hashBytes(byte[] input, int off, int len) { in hashBytes() 135 return HashCode.fromBytes(Arrays.copyOfRange(input, off, off + len)); in hashBytes()
|
D | Murmur3Hash128Test.java | 42 HashCode foxHash = in testKnownValues() 48 HashCode expected = toHashCode(expected1, expected2); in assertHash() 55 private static HashCode toHashCode(long... longs) { in toHashCode() 60 return HashCode.fromBytes(bb.array()); in toHashCode()
|
D | MacHashFunctionTest.java | 102 HashCode.fromBytes(mac.doFinal()), in testMultipleUpdates() 117 HashCode.fromBytes(mac.doFinal("!!!".getBytes(UTF_8))), in testMultipleUpdatesDoFinal() 183 assertEquals(knownOutput, HashCode.fromBytes(mac.doFinal()).toString()); in testEmptyInputs() 192 assertEquals(knownOutput, HashCode.fromBytes(mac.doFinal()).toString()); in testEmptyInputs_mixedAlgorithms() 203 assertEquals(knownOutput, HashCode.fromBytes(mac.doFinal()).toString()); in testKnownInputs() 204 assertEquals(knownOutput, HashCode.fromBytes(mac.doFinal(input.getBytes(UTF_8))).toString()); in testKnownInputs() 216 assertEquals(knownOutput, HashCode.fromBytes(mac.doFinal()).toString()); in testKnownInputs_mixedAlgorithms() 217 assertEquals(knownOutput, HashCode.fromBytes(mac.doFinal(input.getBytes(UTF_8))).toString()); in testKnownInputs_mixedAlgorithms() 277 assertEquals(HashCode.fromBytes(mac.doFinal()), hashFunc.hashBytes(input)); in assertMacHashing() 278 assertEquals(HashCode.fromBytes(mac.doFinal(input)), hashFunc.hashBytes(input)); in assertMacHashing() [all …]
|
/external/guava/guava/src/com/google/common/hash/ |
D | HashCode.java | 36 public abstract class HashCode { class 37 HashCode() {} in HashCode() method in HashCode 107 abstract boolean equalsSameBits(HashCode that); in equalsSameBits() 115 public static HashCode fromInt(int hash) { in fromInt() 119 private static final class IntHashCode extends HashCode implements Serializable { 159 boolean equalsSameBits(HashCode that) { in equalsSameBits() 172 public static HashCode fromLong(long hash) { in fromLong() 176 private static final class LongHashCode extends HashCode implements Serializable { 225 boolean equalsSameBits(HashCode that) { in equalsSameBits() 238 public static HashCode fromBytes(byte[] bytes) { in fromBytes() [all …]
|
D | HashFunction.java | 149 HashCode hashInt(int input); in hashInt() 156 HashCode hashLong(long input); in hashLong() 162 HashCode hashBytes(byte[] input); in hashBytes() 171 HashCode hashBytes(byte[] input, int off, int len); in hashBytes() 179 HashCode hashBytes(ByteBuffer input); in hashBytes() 194 HashCode hashUnencodedChars(CharSequence input); in hashUnencodedChars() 206 HashCode hashString(CharSequence input, Charset charset); in hashString() 214 <T extends @Nullable Object> HashCode hashObject( in hashObject()
|
D | AbstractHashFunction.java | 34 public <T extends @Nullable Object> HashCode hashObject( in hashObject() 40 public HashCode hashUnencodedChars(CharSequence input) { in hashUnencodedChars() 46 public HashCode hashString(CharSequence input, Charset charset) { in hashString() 51 public HashCode hashInt(int input) { in hashInt() 56 public HashCode hashLong(long input) { in hashLong() 61 public HashCode hashBytes(byte[] input) { in hashBytes() 66 public HashCode hashBytes(byte[] input, int off, int len) { in hashBytes() 72 public HashCode hashBytes(ByteBuffer input) { in hashBytes()
|
D | AbstractNonStreamingHashFunction.java | 47 public HashCode hashInt(int input) { in hashInt() 52 public HashCode hashLong(long input) { in hashLong() 57 public HashCode hashUnencodedChars(CharSequence input) { in hashUnencodedChars() 67 public HashCode hashString(CharSequence input, Charset charset) { in hashString() 72 public abstract HashCode hashBytes(byte[] input, int off, int len); in hashBytes() 75 public HashCode hashBytes(ByteBuffer input) { in hashBytes() 106 public HashCode hash() { in hash()
|
D | Hashing.java | 634 public static int consistentHash(HashCode hashCode, int buckets) { in consistentHash() 694 public static HashCode combineOrdered(Iterable<HashCode> hashCodes) { in combineOrdered() 695 Iterator<HashCode> iterator = hashCodes.iterator(); in combineOrdered() 699 for (HashCode hashCode : hashCodes) { in combineOrdered() 707 return HashCode.fromBytesNoCopy(resultBytes); in combineOrdered() 719 public static HashCode combineUnordered(Iterable<HashCode> hashCodes) { in combineUnordered() 720 Iterator<HashCode> iterator = hashCodes.iterator(); in combineUnordered() 723 for (HashCode hashCode : hashCodes) { in combineUnordered() 731 return HashCode.fromBytesNoCopy(resultBytes); in combineUnordered() 795 HashCode makeHash(Hasher[] hashers) { in makeHash() [all …]
|
/external/guava/android/guava/src/com/google/common/hash/ |
D | HashCode.java | 36 public abstract class HashCode { class 37 HashCode() {} in HashCode() method in HashCode 107 abstract boolean equalsSameBits(HashCode that); in equalsSameBits() 115 public static HashCode fromInt(int hash) { in fromInt() 119 private static final class IntHashCode extends HashCode implements Serializable { 159 boolean equalsSameBits(HashCode that) { in equalsSameBits() 172 public static HashCode fromLong(long hash) { in fromLong() 176 private static final class LongHashCode extends HashCode implements Serializable { 225 boolean equalsSameBits(HashCode that) { in equalsSameBits() 238 public static HashCode fromBytes(byte[] bytes) { in fromBytes() [all …]
|
D | HashFunction.java | 149 HashCode hashInt(int input); in hashInt() 156 HashCode hashLong(long input); in hashLong() 162 HashCode hashBytes(byte[] input); in hashBytes() 171 HashCode hashBytes(byte[] input, int off, int len); in hashBytes() 179 HashCode hashBytes(ByteBuffer input); in hashBytes() 194 HashCode hashUnencodedChars(CharSequence input); in hashUnencodedChars() 206 HashCode hashString(CharSequence input, Charset charset); in hashString() 214 <T extends @Nullable Object> HashCode hashObject( in hashObject()
|
D | AbstractHashFunction.java | 34 public <T extends @Nullable Object> HashCode hashObject( in hashObject() 40 public HashCode hashUnencodedChars(CharSequence input) { in hashUnencodedChars() 46 public HashCode hashString(CharSequence input, Charset charset) { in hashString() 51 public HashCode hashInt(int input) { in hashInt() 56 public HashCode hashLong(long input) { in hashLong() 61 public HashCode hashBytes(byte[] input) { in hashBytes() 66 public HashCode hashBytes(byte[] input, int off, int len) { in hashBytes() 72 public HashCode hashBytes(ByteBuffer input) { in hashBytes()
|
D | Hashing.java | 538 public static int consistentHash(HashCode hashCode, int buckets) { in consistentHash() 598 public static HashCode combineOrdered(Iterable<HashCode> hashCodes) { in combineOrdered() 599 Iterator<HashCode> iterator = hashCodes.iterator(); in combineOrdered() 603 for (HashCode hashCode : hashCodes) { in combineOrdered() 611 return HashCode.fromBytesNoCopy(resultBytes); in combineOrdered() 623 public static HashCode combineUnordered(Iterable<HashCode> hashCodes) { in combineUnordered() 624 Iterator<HashCode> iterator = hashCodes.iterator(); in combineUnordered() 627 for (HashCode hashCode : hashCodes) { in combineUnordered() 635 return HashCode.fromBytesNoCopy(resultBytes); in combineUnordered() 699 HashCode makeHash(Hasher[] hashers) { in makeHash() [all …]
|
D | AbstractNonStreamingHashFunction.java | 47 public HashCode hashInt(int input) { in hashInt() 52 public HashCode hashLong(long input) { in hashLong() 57 public HashCode hashUnencodedChars(CharSequence input) { in hashUnencodedChars() 67 public HashCode hashString(CharSequence input, Charset charset) { in hashString() 72 public abstract HashCode hashBytes(byte[] input, int off, int len); in hashBytes() 75 public HashCode hashBytes(ByteBuffer input) { in hashBytes() 106 public HashCode hash() { in hash()
|
/external/setfilters/javatests/com/google/setfilters/cuckoofilter/ |
D | CuckooFilterStrategiesTest.java | 19 import com.google.common.hash.HashCode; 35 HashCode.fromLong(0L), FINGERPRINT_LENGTH)) in simpleModStrategy_computeFingerprint_zeroMapsToOne() 39 HashCode.fromLong(1L << (FINGERPRINT_LENGTH + 1)), FINGERPRINT_LENGTH)) in simpleModStrategy_computeFingerprint_zeroMapsToOne() 43 HashCode.fromLong(0L), MAX_FINGERPRINT_LENGTH)) in simpleModStrategy_computeFingerprint_zeroMapsToOne() 51 HashCode.fromLong(-1L), FINGERPRINT_LENGTH)) in simpleModStrategy_computeFingerprint_mostSignificantBits() 55 HashCode.fromLong(-1L), MAX_FINGERPRINT_LENGTH)) in simpleModStrategy_computeFingerprint_mostSignificantBits() 63 HashCode.fromLong(0L), BUCKET_COUNT)) in simpleModStrategy_computeBucketIndex_smallerThanDivisorStaysUnchanged() 67 HashCode.fromLong(99L), BUCKET_COUNT)) in simpleModStrategy_computeBucketIndex_smallerThanDivisorStaysUnchanged() 75 HashCode.fromLong(100), BUCKET_COUNT)) in simpleModStrategy_computeBucketIndex_largerThanDivisorUsesRemainder() 79 HashCode.fromLong(199L), BUCKET_COUNT)) in simpleModStrategy_computeBucketIndex_largerThanDivisorUsesRemainder()
|
/external/antlr/runtime/Delphi/Sources/Antlr3.Runtime/ |
D | Antlr.Runtime.Tools.pas | 242 HashCode: Integer; 256 function GetBucketIndex(const Key: TKey; HashCode: Integer): Integer; in GetBucketIndex() 258 procedure RehashAdd(HashCode: Integer; const Key: TKey; const Value: TValue); 259 procedure DoAdd(HashCode, Index: Integer; const Key: TKey; const Value: TValue); argument 567 if oldItems[i].HashCode <> 0 then 568 RehashAdd(oldItems[i].HashCode, oldItems[i].Key, oldItems[i].Value); 599 function TDictionary<TKey,TValue>.GetBucketIndex(const Key: TKey; HashCode: Integer): Integer; in TDictionary() 606 start := HashCode and (Length(FItems) - 1); 610 hc := FItems[Result].HashCode; 617 if (hc = HashCode) and FComparer.Equals(FItems[Result].Key, Key) then [all …]
|
/external/setfilters/java/com/google/setfilters/cuckoofilter/ |
D | CuckooFilterStrategies.java | 18 import com.google.common.hash.HashCode; 31 public long computeFingerprint(HashCode hash, int fingerprintLength) { in SIMPLE_MOD() 47 public int computeBucketIndex(HashCode hash, int bucketCount) { in SIMPLE_MOD()
|