add method for sha256 deserialization mappers

This commit is contained in:
Craig Raw 2023-06-30 08:59:08 +02:00
parent d5abf351be
commit 4341973acd

View file

@ -61,6 +61,18 @@ public class Sha256Hash implements Comparable<Sha256Hash> {
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.
*