Fix decodeHex() logic error
This commit is contained in:
parent
f654a19a21
commit
7692fc1255
|
@ -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")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue