public class Hash
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
hash256(byte[] input)
Applies SHA-256 twice to the input and returns the result.
|
static byte[] |
hash256(byte[] input,
int offset,
int length)
Applies SHA-256 twice to the slice of the given length of the input, starting at the given
offset.
|
static byte[] |
hmacSha512(byte[] key,
byte[] input)
Generates HMAC SHA-512 digest for the given
input with the given key. |
static byte[] |
ripemd160(byte[] input)
Generates RipeMD-160 digest for the given
input. |
static java.lang.String |
ripemd160(java.lang.String hexInput)
RipeMD-160 hash function.
|
static byte[] |
sha256(byte[] input)
Generates SHA-256 digest for the given
input. |
static byte[] |
sha256(byte[] input,
int offset,
int length)
Generates SHA-256 digest for the given
input. |
static byte[] |
sha256AndThenRipemd160(byte[] input)
Performs a SHA256 followed by a RIPEMD160.
|
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[] sha256AndThenRipemd160(byte[] input)
input - byte array with the input to be hashedpublic static java.lang.String ripemd160(java.lang.String hexInput)
hexInput - hex encoded input data with optional 0x prefixpublic static byte[] ripemd160(byte[] input)
input.input - The input to digestjava.lang.RuntimeException - If we couldn't find any RipeMD160 providerpublic 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[] hmacSha512(byte[] key,
byte[] input)
input with the given key.key - The key parameterinput - The input to digestpublic static byte[] sha256(byte[] input)
input.input - The input to digestjava.lang.RuntimeException - If we couldn't find any SHA-256 providerpublic static byte[] sha256(byte[] input,
int offset,
int length)
input.input - binary encoded input dataoffset - of start of datalength - of datajava.lang.RuntimeException - If we couldn't find any SHA-256 providerpublic static byte[] hash256(byte[] input)
Neo uses the name hash256 for hashes created in this way.
input - The input to hash.public static byte[] hash256(byte[] input,
int offset,
int length)
Neo uses the name hash256 for hashes created in this way.
input - The input to hash.offset - The offset at which the slice starts.length - The length of the slice to hash.