public class DataHash extends Object
| Constructor and Description |
|---|
DataHash(byte[] hashImprint)
Constructor which initializes the DataHash.
|
DataHash(HashAlgorithm algorithm,
byte[] value)
Constructor which initializes the DataHash.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object object)
Checks if object is equal to current DataHash.
|
HashAlgorithm |
getAlgorithm()
Gets the HashAlgorithm used to compute this DataHash.
|
byte[] |
getImprint()
Gets data imprint.
|
byte[] |
getValue()
Gets the computed hash value for DataHash.
|
int |
hashCode()
Gets the hash code of current object.
|
static boolean |
isDataHash(byte[] imprint)
Checks if the input byte array can be converted to the
DataHash object. |
String |
toString()
Get DataHash as a string including the algorithm name and computed hash value.
|
public DataHash(HashAlgorithm algorithm, byte[] value)
algorithm - HashAlgorithm used to compute this hash.value - hash value computed for the input data.NullPointerException - when one of input parameters is null.IllegalArgumentException - when hash size does not match algorithm size.public DataHash(byte[] hashImprint)
hashImprint - Hash imprint.NullPointerException - when input parameter is null.IllegalArgumentException - when hash imprint is not in correct format.public static boolean isDataHash(byte[] imprint)
DataHash object.imprint - byte array to be checked.DataHash object.NullPointerException - when input is nullpublic final HashAlgorithm getAlgorithm()
public final byte[] getImprint()
Imprint is created by concatenating hash algorithm ID with hash value.
public final byte[] getValue()
public final int hashCode()
public final boolean equals(Object object)
Copyright © 2024 Guardtime. All rights reserved.