Minor: fix bug in SecureHash.parse()

This commit is contained in:
Mike Hearn 2016-03-01 17:00:37 +01:00
parent 1bd63c030c
commit 42cd9a14cb

View File

@ -29,7 +29,7 @@ sealed class SecureHash private constructor(bits: ByteArray) : OpaqueBytes(bits)
// Like static methods in Java, except the 'companion' is a singleton that can have state.
companion object {
@JvmStatic
fun parse(str: String) = BaseEncoding.base16().decode(str.toLowerCase()).let {
fun parse(str: String) = BaseEncoding.base16().decode(str.toUpperCase()).let {
when (it.size) {
32 -> SHA256(it)
else -> throw IllegalArgumentException("Provided string is not 32 bytes in base 16 (hex): $str")