Commit a226dafe authored by Him188moe's avatar Him188moe

update

parent 7e4e94a9
...@@ -100,14 +100,14 @@ fun DataOutputStream.writeTLV0006(qq: Int, password: String, loginTime: ByteArra ...@@ -100,14 +100,14 @@ fun DataOutputStream.writeTLV0006(qq: Int, password: String, loginTime: ByteArra
} }
} }
private fun Int.toByteArray(): ByteArray = byteArrayOf(//todo 检查这方法对不对, 这其实就是从 DataInputStream copy来的 fun Int.toByteArray(): ByteArray = byteArrayOf(//todo 检查这方法对不对, 这其实就是从 DataInputStream copy来的
(this.ushr(24) and 0xFF).toByte(), (this.ushr(24) and 0xFF).toByte(),
(this.ushr(16) and 0xFF).toByte(), (this.ushr(16) and 0xFF).toByte(),
(this.ushr(8) and 0xFF).toByte(), (this.ushr(8) and 0xFF).toByte(),
(this.ushr(0) and 0xFF).toByte() (this.ushr(0) and 0xFF).toByte()
) )
private fun Int.toHexString(separator: String = " "): String = this.toByteArray().toHexString(separator); fun Int.toHexString(separator: String = " "): String = this.toByteArray().toHexString(separator);
private fun md5(str: String): ByteArray = MessageDigest.getInstance("MD5").digest(str.toByteArray()) private fun md5(str: String): ByteArray = MessageDigest.getInstance("MD5").digest(str.toByteArray())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment