MCPcopy
hub / github.com/google/guava / hash

Method hash

android/guava/src/com/google/common/io/Files.java:621–628  ·  view source on GitHub ↗

Computes the hash code of the {@code file} using {@code hashFunction}. @param file the file to read @param hashFunction the hash function to use to hash the data @return the {@link HashCode} of all of the bytes in the file @throws IOException if an I/O error occurs @since 12.0 @deprecated Prefer {@

(File file, HashFunction hashFunction)

Source from the content-addressed store, hash-verified

619 * @deprecated Prefer {@code asByteSource(file).hash(hashFunction)}.
620 */
621 @Deprecated
622 @InlineMe(
623 replacement = "Files.asByteSource(file).hash(hashFunction)",
624 imports = "com.google.common.io.Files")
625 public
626 static HashCode hash(File file, HashFunction hashFunction) throws IOException {
627 return asByteSource(file).hash(hashFunction);
628 }
629
630 /**
631 * Fully maps a file read-only in to memory as per {@link

Callers 1

testHashMethod · 0.95

Calls 2

asByteSourceMethod · 0.95
hashMethod · 0.65

Tested by 1

testHashMethod · 0.76