Last active 1753263630

Kotlin版本

Revision 59b138a8ac3c3feaf1b9cc045b8e4f1c81de9a88

PassUtil.kt Raw
1import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
2
3/**
4 * 密码工具类
5 * @author ThatCoder
6 */
7class PassUtil private constructor() {
8 companion object {
9 private val encoder = BCryptPasswordEncoder()
10
11 /**
12 * 密码加密
13 * @author ThatCoder
14 * @param password 密码
15 * @return 加密后的密码 length:60
16 */
17 @JvmStatic
18 fun encode(password: String): String {
19 return encoder.encode(password)
20 }
21 }
22}