public class Hash
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
blake2b256(byte[] input)
Blake2-256 hash function.
|
static byte[] |
hash(byte[] input,
java.lang.String algorithm)
Generates a digest for the given
input. |
static byte[] |
hmacSha512(byte[] key,
byte[] input) |
static byte[] |
sha256(byte[] input)
Generates SHA-256 digest for the given
input. |
static byte[] |
sha256hash160(byte[] input) |
static byte[] |
sha3(byte[] input)
Keccak-256 hash function.
|
static byte[] |
sha3(byte[] input,
int offset,
int length)
Keccak-256 hash function.
|
static java.lang.String |
sha3(java.lang.String hexInput)
Keccak-256 hash function.
|
static java.lang.String |
sha3String(java.lang.String utf8String)
Keccak-256 hash function that operates on a UTF-8 encoded String.
|
public static byte[] hash(byte[] input,
java.lang.String algorithm)
input.input - The input to digestalgorithm - The hash algorithm to usejava.lang.RuntimeException - If we couldn't find any provider for the given algorithmpublic static java.lang.String sha3(java.lang.String hexInput)
hexInput - hex encoded input data with optional 0x prefixpublic static byte[] sha3(byte[] input,
int offset,
int length)
input - binary encoded input dataoffset - of start of datalength - of datapublic static byte[] sha3(byte[] input)
input - binary encoded input datapublic static java.lang.String sha3String(java.lang.String utf8String)
utf8String - UTF-8 encoded stringpublic static byte[] sha256(byte[] input)
input.input - The input to digestjava.lang.RuntimeException - If we couldn't find any SHA-256 providerpublic static byte[] hmacSha512(byte[] key,
byte[] input)
public static byte[] sha256hash160(byte[] input)
public static byte[] blake2b256(byte[] input)
input - binary encoded input data