public final class Hasher
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.util.Map<Manifest,java.security.MessageDigest> |
createManifestToMessageDigestMap(java.util.Collection<SupportedAlgorithm> algorithms)
|
static void |
hash(java.nio.file.Path path,
java.util.Map<Manifest,java.security.MessageDigest> manifestToMessageDigestMap)
Update the Manifests with the file's hash
|
static java.lang.String |
hash(java.nio.file.Path path,
java.security.MessageDigest messageDigest)
Create a HEX formatted string checksum hash of the file
|
public static java.lang.String hash(java.nio.file.Path path,
java.security.MessageDigest messageDigest)
throws java.io.IOException
path - the Path (file) to hashmessageDigest - the MessageDigest object representing the hashing algorithmjava.io.IOException - if there is a problem reading the filepublic static void hash(java.nio.file.Path path,
java.util.Map<Manifest,java.security.MessageDigest> manifestToMessageDigestMap)
throws java.io.IOException
path - the Path (file) to hashmanifestToMessageDigestMap - the map between Manifest and MessageDigestjava.io.IOException - if there is a problem reading the filepublic static java.util.Map<Manifest,java.security.MessageDigest> createManifestToMessageDigestMap(java.util.Collection<SupportedAlgorithm> algorithms) throws java.security.NoSuchAlgorithmException
algorithms - the SupportedAlgorithm that you which to map to MessageDigestManifest and MessageDigestjava.security.NoSuchAlgorithmException - if MessageDigest doesn't support the algorithm