refactor(bcrypt): 重构 BCrypt.kt 文件
- 将 BCrypt 对象中的函数转换为顶级函数 - 添加 @JvmName 注解以自定义 JVM 方法名 - 更新相关文件中的导入和引用 - 调整 DateTime 类的 parse 和 format 方法 - 优化 StringUtils 中的 isEmpty 方法
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
* ProjectName mingli-utils
|
||||
* ModuleName mingli-utils.main
|
||||
* CurrentFile HashUtils.kt
|
||||
* LastUpdate 2025-09-17 11:57:26
|
||||
* LastUpdate 2025-09-17 16:20:57
|
||||
* UpdateUser MingLiPro
|
||||
*/
|
||||
@file:JvmName("HashUtils")
|
||||
@@ -24,7 +24,8 @@
|
||||
package com.mingliqiye.utils.hash
|
||||
|
||||
|
||||
import com.mingliqiye.utils.bcrypt.BCrypt
|
||||
import com.mingliqiye.utils.bcrypt.checkpw
|
||||
import com.mingliqiye.utils.bcrypt.hashpw
|
||||
import java.io.File
|
||||
import java.io.FileInputStream
|
||||
import java.io.IOException
|
||||
@@ -87,7 +88,7 @@ private fun bytesToHex(bytes: ByteArray): String {
|
||||
* @return 加密后的 BCrypt 哈希字符串
|
||||
*/
|
||||
fun bcrypt(string: String): String {
|
||||
return BCrypt.hashpw(string)
|
||||
return hashpw(string)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,5 +99,5 @@ fun bcrypt(string: String): String {
|
||||
* @return 如果匹配返回 true,否则返回 false
|
||||
*/
|
||||
fun checkBcrypt(string: String, bcrypted: String): Boolean {
|
||||
return BCrypt.checkpw(string, bcrypted)
|
||||
return checkpw(string, bcrypted)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user