public enum LockHashAlgorithm extends java.lang.Enum<LockHashAlgorithm> implements Hasher
Enum Constant and Description |
---|
HASH_160
hashed twice: first with SHA-256 and then with RIPEMD-160 (BTC Compat)
|
HASH_256
Hashed twice with SHA-256 (BTC Compat)
|
SHA3_256
hashed using SHA3-256 (Catapult Native)
|
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_SECRET_BYTE_ARRAY_SIZE
The default size used for secret hashes.
|
static int |
DEFAULT_SECRET_HEX_SIZE
The default size used for secret hashes.
|
static java.lang.String |
VALIDATOR_REGEX
The regex used to validate a hashed value.
|
Modifier and Type | Method and Description |
---|---|
int |
getValue() |
byte[] |
hash(byte[]... values)
Use this method to just hash values when the LockHashAlgorithmType is known.
|
static LockHashAlgorithm |
rawValueOf(int value) |
static boolean |
validator(LockHashAlgorithm hashType,
java.lang.String input)
Validate hash algorithm and hash have desired format
|
static LockHashAlgorithm |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static LockHashAlgorithm[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final LockHashAlgorithm SHA3_256
public static final LockHashAlgorithm HASH_160
public static final LockHashAlgorithm HASH_256
public static final java.lang.String VALIDATOR_REGEX
public static final int DEFAULT_SECRET_BYTE_ARRAY_SIZE
public static final int DEFAULT_SECRET_HEX_SIZE
public static LockHashAlgorithm[] values()
for (LockHashAlgorithm c : LockHashAlgorithm.values()) System.out.println(c);
public static LockHashAlgorithm 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 static LockHashAlgorithm rawValueOf(int value)
public static boolean validator(LockHashAlgorithm hashType, java.lang.String input)
hashType
- Hash typeinput
- Input hashedpublic byte[] hash(byte[]... values)
public int getValue()