mirror of
https://github.com/sparrowwallet/drongo.git
synced 2024-12-26 01:56:44 +00:00
add method for sha256 deserialization mappers
This commit is contained in:
parent
d5abf351be
commit
4341973acd
1 changed files with 12 additions and 0 deletions
|
@ -61,6 +61,18 @@ public class Sha256Hash implements Comparable<Sha256Hash> {
|
||||||
return wrap(Utils.hexToBytes(hexString));
|
return wrap(Utils.hexToBytes(hexString));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Duplicate method with default name for deserialization mappers.
|
||||||
|
*
|
||||||
|
* @param hexString a hash value represented as a hex string
|
||||||
|
* @return a new instance
|
||||||
|
* @throws IllegalArgumentException if the given string is not a valid
|
||||||
|
* hex string, or if it does not represent exactly 32 bytes
|
||||||
|
*/
|
||||||
|
public static Sha256Hash fromString(String hexString) {
|
||||||
|
return wrap(hexString);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new instance that wraps the given hash value, but with byte order reversed.
|
* Creates a new instance that wraps the given hash value, but with byte order reversed.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue