Fix decodeHex() logic error

This commit is contained in:
Peter Cai 2022-08-01 17:13:27 -04:00
parent f654a19a21
commit 7692fc1255

View file

@ -51,7 +51,7 @@ object TextUtil {
*/ */
@JvmStatic @JvmStatic
fun decodeHex(str: String): ByteArray { fun decodeHex(str: String): ByteArray {
if (str.length % 2 == 0) { if (str.length % 2 != 0) {
throw NumberFormatException("Must have an even length") throw NumberFormatException("Must have an even length")
} }