Home
last modified time | relevance | path

Searched refs:hashBytes (Results 1 – 25 of 56) sorted by relevance

123

/external/guava/android/guava/src/com/google/common/hash/
DAbstractNonStreamingHashFunction.java47 return hashBytes(ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN).putInt(input).array()); in hashInt()
52 return hashBytes(ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN).putLong(input).array()); in hashLong()
62 return hashBytes(buffer.array()); in hashUnencodedChars()
67 return hashBytes(input.toString().getBytes(charset)); in hashString()
71 public abstract HashCode hashBytes(byte[] input, int off, int len); in hashBytes() method in AbstractNonStreamingHashFunction
74 public HashCode hashBytes(ByteBuffer input) { in hashBytes() method in AbstractNonStreamingHashFunction
106 return hashBytes(stream.byteArray(), 0, stream.length()); in hash()
DAbstractHashFunction.java58 public HashCode hashBytes(byte[] input) { in hashBytes() method in AbstractHashFunction
59 return hashBytes(input, 0, input.length); in hashBytes()
63 public HashCode hashBytes(byte[] input, int off, int len) { in hashBytes() method in AbstractHashFunction
69 public HashCode hashBytes(ByteBuffer input) { in hashBytes() method in AbstractHashFunction
DHashFunction.java162 HashCode hashBytes(byte[] input); in hashBytes() method
171 HashCode hashBytes(byte[] input, int off, int len); in hashBytes() method
179 HashCode hashBytes(ByteBuffer input); in hashBytes() method
DMurmur3_32HashFunction.java189 return hashBytes(input.toString().getBytes(charset)); in hashString()
208 return hashBytes(input.toString().getBytes(charset)); in hashString()
213 public HashCode hashBytes(byte[] input, int off, int len) { in hashBytes() method in Murmur3_32HashFunction
/external/guava/guava/src/com/google/common/hash/
DAbstractNonStreamingHashFunction.java47 return hashBytes(ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN).putInt(input).array()); in hashInt()
52 return hashBytes(ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN).putLong(input).array()); in hashLong()
62 return hashBytes(buffer.array()); in hashUnencodedChars()
67 return hashBytes(input.toString().getBytes(charset)); in hashString()
71 public abstract HashCode hashBytes(byte[] input, int off, int len); in hashBytes() method in AbstractNonStreamingHashFunction
74 public HashCode hashBytes(ByteBuffer input) { in hashBytes() method in AbstractNonStreamingHashFunction
106 return hashBytes(stream.byteArray(), 0, stream.length()); in hash()
DAbstractHashFunction.java58 public HashCode hashBytes(byte[] input) { in hashBytes() method in AbstractHashFunction
59 return hashBytes(input, 0, input.length); in hashBytes()
63 public HashCode hashBytes(byte[] input, int off, int len) { in hashBytes() method in AbstractHashFunction
69 public HashCode hashBytes(ByteBuffer input) { in hashBytes() method in AbstractHashFunction
DHashFunction.java162 HashCode hashBytes(byte[] input); in hashBytes() method
171 HashCode hashBytes(byte[] input, int off, int len); in hashBytes() method
179 HashCode hashBytes(ByteBuffer input); in hashBytes() method
DMurmur3_32HashFunction.java189 return hashBytes(input.toString().getBytes(charset)); in hashString()
208 return hashBytes(input.toString().getBytes(charset)); in hashString()
213 public HashCode hashBytes(byte[] input, int off, int len) { in hashBytes() method in Murmur3_32HashFunction
/external/guava/android/guava-tests/test/com/google/common/hash/
DSipHashFunctionTest.java126 assertEquals(0xa129ca6149be45e5L, Hashing.sipHash24(k0, k1).hashBytes(message).asLong()); in test15ByteStringFromSipHashPaper()
155 SIP_WITH_KEY.hashBytes(col1), in testCollisionsDueToIncorrectSignExtension()
156 SIP_WITH_KEY.hashBytes(col2), in testCollisionsDueToIncorrectSignExtension()
157 SIP_WITH_KEY.hashBytes(col3)); in testCollisionsDueToIncorrectSignExtension()
175 assertEquals(expected, SIP_WITH_KEY.hashBytes(input).asLong()); in assertSip()
177 assertEquals(expected, SIP_WITHOUT_KEY.hashBytes(input).asLong()); in assertSip()
DHashTestUtils.java58 int hashBytes = hashbits / 8; in verifyHashFunction() local
61 byte[] hashes = new byte[hashBytes * 256]; in verifyHashFunction()
68 System.arraycopy(hash, 0, hashes, i * hashBytes, hash.length); in verifyHashFunction()
494 assertEquals(hashFunction.hashBytes(bytes), hashFunction.hashBytes(ByteBuffer.wrap(bytes))); in assertHashByteBufferMatchesBytes()
502 HashCode unused = hashFunction.hashBytes(buffer); in assertHashByteBufferExhaustsBuffer()
512 assertEquals(hashFunction.hashBytes(littleEndian), hashFunction.hashBytes(littleEndian)); in assertHashByteBufferPreservesByteOrder()
532 HashCode unused = hashFunction.hashBytes(new byte[64], 0, 0); in assertHashBytesThrowsCorrectExceptions()
536 hashFunction.hashBytes(new byte[128], -1, 128); in assertHashBytesThrowsCorrectExceptions()
541 hashFunction.hashBytes(new byte[128], 64, 256 /* too long len */); in assertHashBytesThrowsCorrectExceptions()
546 hashFunction.hashBytes(new byte[64], 0, -1); in assertHashBytesThrowsCorrectExceptions()
[all …]
DMurmur3Hash32Test.java69 murmur3_32().hashBytes("ABCDefGHI\u0799".getBytes(Charsets.UTF_8)), in testSimpleStringUtf8()
92 murmur3_32().hashBytes(str.getBytes(Charsets.UTF_8)), in testStringInputsUtf8()
106 return murmur3_32(seed).hashBytes(input).asBytes(); in testParanoidHashBytes()
139 murmur3_32().hashBytes(str.getBytes(Charsets.UTF_8)), in testInvalidUnicodeHashString()
148 murmur3_32().hashBytes(str.getBytes(Charsets.UTF_8)), in testInvalidUnicodeHasherPutString()
DHashingInputStreamTest.java108 HashCode expectedHash = Hashing.md5().hashBytes(testBytes); in testHash_hashesCorrectly()
119 HashCode expectedHash = Hashing.md5().hashBytes(testBytes); in testHash_hashesCorrectlyReadOutOfBound()
131 HashCode expectedHash = Hashing.md5().hashBytes(new byte[] {'m', 's'}); in testHash_hashesCorrectlyForSkipping()
DChecksumHashFunctionTest.java74 assertEquals(value, func.hashBytes(bytes).padToLong()); in assertChecksum()
82 assertEquals(expected, func.hashBytes(bytes).asInt()); in assertHash32()
DMacHashFunctionTest.java204 assertEquals(knownOutput, Hashing.hmacMd5(MD5_KEY).hashBytes(input.getBytes(UTF_8)).toString()); in testKnownInputs()
218 knownOutput, Hashing.hmacMd5(SHA1_KEY).hashBytes(input.getBytes(UTF_8)).toString()); in testKnownInputs_mixedAlgorithms()
283 assertEquals(HashCode.fromBytes(mac.doFinal()), hashFunc.hashBytes(input)); in assertMacHashing()
284 assertEquals(HashCode.fromBytes(mac.doFinal(input)), hashFunc.hashBytes(input)); in assertMacHashing()
404 assertEquals(HashCode.fromString(expected), hashFunc.hashBytes(data)); in checkHmac()
DMessageDigestHashFunctionTest.java101 HashCode.fromBytes(digest.digest(input)), ALGORITHMS.get(algorithmName).hashBytes(input)); in assertMessageDigestHashing()
105 new MessageDigestHashFunction(algorithmName, bytes, algorithmName).hashBytes(input)); in assertMessageDigestHashing()
/external/guava/guava-tests/test/com/google/common/hash/
DSipHashFunctionTest.java126 assertEquals(0xa129ca6149be45e5L, Hashing.sipHash24(k0, k1).hashBytes(message).asLong()); in test15ByteStringFromSipHashPaper()
155 SIP_WITH_KEY.hashBytes(col1), in testCollisionsDueToIncorrectSignExtension()
156 SIP_WITH_KEY.hashBytes(col2), in testCollisionsDueToIncorrectSignExtension()
157 SIP_WITH_KEY.hashBytes(col3)); in testCollisionsDueToIncorrectSignExtension()
175 assertEquals(expected, SIP_WITH_KEY.hashBytes(input).asLong()); in assertSip()
177 assertEquals(expected, SIP_WITHOUT_KEY.hashBytes(input).asLong()); in assertSip()
DHashTestUtils.java58 int hashBytes = hashbits / 8; in verifyHashFunction() local
61 byte[] hashes = new byte[hashBytes * 256]; in verifyHashFunction()
68 System.arraycopy(hash, 0, hashes, i * hashBytes, hash.length); in verifyHashFunction()
494 assertEquals(hashFunction.hashBytes(bytes), hashFunction.hashBytes(ByteBuffer.wrap(bytes))); in assertHashByteBufferMatchesBytes()
502 HashCode unused = hashFunction.hashBytes(buffer); in assertHashByteBufferExhaustsBuffer()
512 assertEquals(hashFunction.hashBytes(littleEndian), hashFunction.hashBytes(littleEndian)); in assertHashByteBufferPreservesByteOrder()
532 HashCode unused = hashFunction.hashBytes(new byte[64], 0, 0); in assertHashBytesThrowsCorrectExceptions()
536 hashFunction.hashBytes(new byte[128], -1, 128); in assertHashBytesThrowsCorrectExceptions()
541 hashFunction.hashBytes(new byte[128], 64, 256 /* too long len */); in assertHashBytesThrowsCorrectExceptions()
546 hashFunction.hashBytes(new byte[64], 0, -1); in assertHashBytesThrowsCorrectExceptions()
[all …]
DMurmur3Hash32Test.java69 murmur3_32().hashBytes("ABCDefGHI\u0799".getBytes(Charsets.UTF_8)), in testSimpleStringUtf8()
92 murmur3_32().hashBytes(str.getBytes(Charsets.UTF_8)), in testStringInputsUtf8()
106 return murmur3_32(seed).hashBytes(input).asBytes(); in testParanoidHashBytes()
139 murmur3_32().hashBytes(str.getBytes(Charsets.UTF_8)), in testInvalidUnicodeHashString()
148 murmur3_32().hashBytes(str.getBytes(Charsets.UTF_8)), in testInvalidUnicodeHasherPutString()
DHashingInputStreamTest.java108 HashCode expectedHash = Hashing.md5().hashBytes(testBytes); in testHash_hashesCorrectly()
119 HashCode expectedHash = Hashing.md5().hashBytes(testBytes); in testHash_hashesCorrectlyReadOutOfBound()
131 HashCode expectedHash = Hashing.md5().hashBytes(new byte[] {'m', 's'}); in testHash_hashesCorrectlyForSkipping()
DChecksumHashFunctionTest.java74 assertEquals(value, func.hashBytes(bytes).padToLong()); in assertChecksum()
82 assertEquals(expected, func.hashBytes(bytes).asInt()); in assertHash32()
DMacHashFunctionTest.java204 assertEquals(knownOutput, Hashing.hmacMd5(MD5_KEY).hashBytes(input.getBytes(UTF_8)).toString()); in testKnownInputs()
218 knownOutput, Hashing.hmacMd5(SHA1_KEY).hashBytes(input.getBytes(UTF_8)).toString()); in testKnownInputs_mixedAlgorithms()
283 assertEquals(HashCode.fromBytes(mac.doFinal()), hashFunc.hashBytes(input)); in assertMacHashing()
284 assertEquals(HashCode.fromBytes(mac.doFinal(input)), hashFunc.hashBytes(input)); in assertMacHashing()
404 assertEquals(HashCode.fromString(expected), hashFunc.hashBytes(data)); in checkHmac()
DMessageDigestHashFunctionTest.java101 HashCode.fromBytes(digest.digest(input)), ALGORITHMS.get(algorithmName).hashBytes(input)); in assertMessageDigestHashing()
105 new MessageDigestHashFunction(algorithmName, bytes, algorithmName).hashBytes(input)); in assertMessageDigestHashing()
/external/guava/guava-tests/benchmark/com/google/common/hash/
DHashFunctionBenchmark.java69 result ^= hashFunction.hashBytes(testBytes).asBytes()[0]; in hashFunction()
79 result ^= hashFunction.hashBytes(testBytes, 1, testBytes.length - 1).asBytes()[0]; in hashFunctionWithOffset()
/external/guava/android/guava-tests/benchmark/com/google/common/hash/
DHashFunctionBenchmark.java69 result ^= hashFunction.hashBytes(testBytes).asBytes()[0]; in hashFunction()
79 result ^= hashFunction.hashBytes(testBytes, 1, testBytes.length - 1).asBytes()[0]; in hashFunctionWithOffset()
/external/turbine/javatests/com/google/turbine/zip/
DZipTest.java95 je.setCrc(Hashing.crc32().hashBytes(bytes).padToLong()); in createEntry()
103 result.put(e.name(), Hashing.goodFastHash(128).hashBytes(e.data()).padToLong()); in actual()
117 .hashBytes(ByteStreams.toByteArray(jf.getInputStream(je))) in expected()

123