From 0d2269d2c4d7fbaae084e45e1c49f613c8e03232 Mon Sep 17 00:00:00 2001 From: Celeter <48249130+Celeter@users.noreply.github.com> Date: Tue, 29 Sep 2020 18:21:29 +0800 Subject: [PATCH] update --- app/src/main/java/io/legado/app/utils/StringUtils.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/utils/StringUtils.kt b/app/src/main/java/io/legado/app/utils/StringUtils.kt index 78751ae16..4ee24ba2a 100644 --- a/app/src/main/java/io/legado/app/utils/StringUtils.kt +++ b/app/src/main/java/io/legado/app/utils/StringUtils.kt @@ -295,17 +295,17 @@ object StringUtils { fun byteToHexString(bytes: ByteArray?): String { if (bytes == null) return "" - val sb = StringBuilder() + val sb = StringBuilder(bytes.size * 2) for (b in bytes) { val hex = 0xff and b.toInt() if (hex < 16) { sb.append('0') } - sb.append(Integer.toHexString(hex)).append(" ") + sb.append(Integer.toHexString(hex)) } return sb.toString() } - + fun hexStringToByte(hexString: String): ByteArray? { val hexStr = hexString.replace(" ", "") val len = hexStr.length