feat(build): 重构项目并添加 Maven 发布支持
- 更新 .gitignore 文件,添加 secret.gpg - 移除 .prettierrc 文件 - 重构 AES 加密工具类,使用新的 Base64 实现 - 新增 Base16、Base64 和 Base91 编解码工具类 - 新增 BaseCodec接口和 BaseUtils 工具类 - 更新 build.gradle.kts 配置,添加 Maven 发布和签名 - 修复 ByteUtils 和 DateTime 工具类中的问题 - 重构 UUID 使用自己的实现 不依赖标准库以及其他的 UUID库
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
* ProjectName mingli-utils
|
||||
* ModuleName mingli-utils.main
|
||||
* CurrentFile ByteUtils.kt
|
||||
* LastUpdate 2025-09-15 17:26:34
|
||||
* LastUpdate 2025-09-16 16:55:36
|
||||
* UpdateUser MingLiPro
|
||||
*/
|
||||
@file:JvmName("ByteUtils")
|
||||
@@ -39,8 +39,20 @@ const val ESC_RESERVED: Byte = 0x06
|
||||
* @return 包含每个字节对应十六进制字符串的列表
|
||||
*/
|
||||
fun ByteArray.getByteArrayString(): MutableList<String> {
|
||||
return this.toList().stream()
|
||||
.map { a -> String.format("0X%02X", a!!.toInt() and 0xFF) }
|
||||
return this.toList().stream().map { a -> String.format("0X%02X", a!!.toInt() and 0xFF) }
|
||||
.collect(com.mingliqiye.utils.stream.toList()) as MutableList<String>
|
||||
}
|
||||
|
||||
|
||||
fun Char.hexDigitToValue(): Int {
|
||||
return when (this) {
|
||||
in '0'..'9' -> this - '0'
|
||||
in 'A'..'F' -> this - 'A' + 10
|
||||
in 'a'..'f' -> this - 'a' + 10
|
||||
else -> throw NumberFormatException("Invalid hex character: $this")
|
||||
}
|
||||
}
|
||||
|
||||
private fun hexStringToByteArray(string: String): ByteArray {
|
||||
return string.hexToByteArray()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user