diff --git a/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/utils/Utils.kt b/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/utils/Utils.kt index ddfc61010..4a45533c9 100644 --- a/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/utils/Utils.kt +++ b/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/utils/Utils.kt @@ -84,6 +84,11 @@ fun dataDecode(byteArray: ByteArray, t: (DataInputStream) -> R): R = byteArr fun ByteArray.decode(t: (DataInputStream) -> R): R = this.dataInputStream().let(t) +fun ByteArray.decryptBy(key: ByteArray): ByteArray = TEA.decrypt(this, key) + +fun ByteArray.decryptBy(key: String): ByteArray = TEA.decrypt(this, key) + + fun DataInputStream.skip(n: Number) { this.skip(n.toLong()) }