public class HashExtensions extends Object
HashExtensions.| Constructor and Description |
|---|
HashExtensions() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
getMerkleRootHash(Queue<byte[]> hashQueue,
@NonNull de.alpharogroup.crypto.algorithm.HashAlgorithm algorithm)
Gets the hash value of the given queue and the given algorithm.
|
static byte[] |
hash(byte[] input,
byte[] hash,
byte[] signature,
long timestamp,
@NonNull de.alpharogroup.crypto.algorithm.HashAlgorithm algorithm)
Calculates the hash value as byte array from the given fields
|
static byte[] |
hash(byte[] input,
byte[] publicKey,
@NonNull de.alpharogroup.crypto.algorithm.HashAlgorithm algorithm)
Calculates the hash value as byte array from the given fields
|
static byte[] |
hash(byte[] input,
byte[] hash,
long signature,
long timestamp,
@NonNull de.alpharogroup.crypto.algorithm.HashAlgorithm algorithm)
Calculates the hash value as byte array from the given fields
|
static byte[] |
hash(byte[] hashIt,
de.alpharogroup.crypto.algorithm.HashAlgorithm hashAlgorithm)
Hashes the given
byte[] object with the given parameters. |
static byte[] |
hash(byte[] hashIt,
String salt,
de.alpharogroup.crypto.algorithm.HashAlgorithm hashAlgorithm,
Charset charset)
Hashes the given
byte[] object with the given parameters. |
static String |
hash(String hashIt,
String salt,
de.alpharogroup.crypto.algorithm.HashAlgorithm hashAlgorithm,
Charset charset)
Hashes the given
String object with the given parameters. |
static String |
hashAndBase64(String hashIt,
String salt,
de.alpharogroup.crypto.algorithm.HashAlgorithm hashAlgorithm,
Charset charset)
Hashes and encodes it with base64 from the given
String object with the given
parameters. |
public static byte[] hash(byte[] hashIt,
de.alpharogroup.crypto.algorithm.HashAlgorithm hashAlgorithm)
throws NoSuchAlgorithmException
byte[] object with the given parameters.hashIt - the hash ithashAlgorithm - the hash algorithmString objectNoSuchAlgorithmException - is thrown if instantiation of the MessageDigest object fails.public static byte[] hash(byte[] hashIt,
String salt,
de.alpharogroup.crypto.algorithm.HashAlgorithm hashAlgorithm,
Charset charset)
throws NoSuchAlgorithmException
byte[] object with the given parameters.hashIt - the hash itsalt - the salthashAlgorithm - the hash algorithmcharset - the charsetString objectNoSuchAlgorithmException - is thrown if instantiation of the MessageDigest object fails.public static String hash(String hashIt, String salt, de.alpharogroup.crypto.algorithm.HashAlgorithm hashAlgorithm, Charset charset) throws NoSuchAlgorithmException
String object with the given parameters.hashIt - the hash itsalt - the salthashAlgorithm - the hash algorithmcharset - the charsetString objectNoSuchAlgorithmException - is thrown if instantiation of the MessageDigest object fails.public static String hashAndBase64(String hashIt, String salt, de.alpharogroup.crypto.algorithm.HashAlgorithm hashAlgorithm, Charset charset) throws NoSuchAlgorithmException
String object with the given
parameters.hashIt - the hash itsalt - the salthashAlgorithm - the hash algorithmcharset - the charsetString objectNoSuchAlgorithmException - is thrown if instantiation of the MessageDigest object fails.public static byte[] hash(byte[] input,
byte[] hash,
byte[] signature,
long timestamp,
@NonNull
@NonNull de.alpharogroup.crypto.algorithm.HashAlgorithm algorithm)
input - the input hashhash - the merklesignature - the signaturetimestamp - the timestampalgorithm - the hash algorithmpublic static byte[] hash(byte[] input,
byte[] hash,
long signature,
long timestamp,
@NonNull
@NonNull de.alpharogroup.crypto.algorithm.HashAlgorithm algorithm)
input - the input hashhash - the merklesignature - the signaturetimestamp - the timestampalgorithm - the hash algorithmpublic static byte[] hash(byte[] input,
byte[] publicKey,
@NonNull
@NonNull de.alpharogroup.crypto.algorithm.HashAlgorithm algorithm)
input - the input hashpublicKey - the public keyalgorithm - the algorithmpublic static byte[] getMerkleRootHash(Queue<byte[]> hashQueue, @NonNull @NonNull de.alpharogroup.crypto.algorithm.HashAlgorithm algorithm)
hashQueue - the hash queuealgorithm - the algorithmCopyright © 2015–2019 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.