public class HashUtils
extends java.lang.Object
| Constructor and Description |
|---|
HashUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addToHasher(Hasher hasher,
java.io.InputStream is)
Copies the content of the provided
InputStream to the provided Hasher. |
static void |
addToHasher(Hasher hasher,
java.nio.file.Path path)
Copies the content of the provided
Path to the provided Hasher. |
static boolean |
equals(HashCode a,
java.lang.String b)
Checks if the provided
HashCode equals the provided hash String. |
static HashCode |
hash(HashFunction func,
java.io.InputStream is)
Adds Creates a
HashCode from the given InputStream with the given HashFunction. |
static HashCode |
hash(HashFunction func,
java.nio.file.Path path)
Adds Creates a
HashCode from the content of the given Path with the given HashFunction. |
public static HashCode hash(HashFunction func,
java.nio.file.Path path)
throws java.io.IOException
HashCode from the content of the given Path with the given HashFunction.func - The HashFunction to use.path - The Path to read from.HashCode.java.io.IOException - If an IO error occurred whilst reading from or opening the Pathpublic static HashCode hash(HashFunction func,
java.io.InputStream is)
throws java.io.IOException
HashCode from the given InputStream with the given HashFunction.func - The HashFunction to use.is - The InputStream to read from.HashCode.java.io.IOException - If an IO error occurred whilst reading the InputStream.public static void addToHasher(Hasher hasher,
java.nio.file.Path path)
throws java.io.IOException
Path to the provided Hasher.hasher - The hasher.path - The Path.java.io.IOException - If something is bork.public static void addToHasher(Hasher hasher,
java.io.InputStream is)
throws java.io.IOException
InputStream to the provided Hasher.hasher - The hasher.is - The InputStream.java.io.IOException - If something is bork.public static boolean equals(HashCode a,
java.lang.String b)
HashCode equals the provided hash String.a - The first hash.b - The second hash.