| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
bytesHashToString(byte[] a) |
byte[] |
getHashBytes(java.io.File file) |
byte[] |
getHashBytes(java.lang.String str) |
java.lang.String |
getHashStr(java.io.File file) |
java.lang.String |
getHashStr(java.lang.String str) |
java.lang.String |
getName() |
static boolean |
isSameHash(byte[] a,
byte[] b) |
static boolean |
isSameHash(java.lang.String a,
byte[] b) |
java.lang.String |
sanitizeHashStr(java.lang.String raw)
Validates and sanitizes a hash string.
|
static byte[] |
stringHashToBytes(java.lang.String a) |
static HashUtils |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static HashUtils[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static HashUtils[] values()
for (HashUtils c : HashUtils.values()) System.out.println(c);
public static HashUtils valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic java.lang.String getName()
public java.lang.String getHashStr(java.lang.String str)
public byte[] getHashBytes(java.lang.String str)
public java.lang.String getHashStr(java.io.File file)
throws java.io.IOException
java.io.IOExceptionpublic byte[] getHashBytes(java.io.File file)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String sanitizeHashStr(java.lang.String raw)
throws InvalidHashException
raw - raw hash stringInvalidHashException - if the hash is invalid for any of the reasons described above.public static boolean isSameHash(java.lang.String a,
byte[] b)
throws org.apache.commons.codec.DecoderException
org.apache.commons.codec.DecoderExceptionpublic static boolean isSameHash(byte[] a,
byte[] b)
public static byte[] stringHashToBytes(java.lang.String a)
throws org.apache.commons.codec.DecoderException
org.apache.commons.codec.DecoderExceptionpublic static java.lang.String bytesHashToString(byte[] a)