mirror of
https://github.com/ZSCNetSupportDept/WechatTicketSystem.git
synced 2025-10-30 01:46:18 +08:00
new operator entity
This commit is contained in:
21
src/main/java/love/sola/netsupport/util/Crypt.java
Normal file
21
src/main/java/love/sola/netsupport/util/Crypt.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package love.sola.netsupport.util;
|
||||
|
||||
import org.mindrot.jbcrypt.BCrypt;
|
||||
|
||||
/**
|
||||
* ***********************************************
|
||||
* Created by Sola on 2015/12/6.
|
||||
* Don't modify this source without my agreement
|
||||
* ***********************************************
|
||||
*/
|
||||
public class Crypt {
|
||||
|
||||
public static String hash(String pw) {
|
||||
return BCrypt.hashpw(pw, BCrypt.gensalt());
|
||||
}
|
||||
|
||||
public static boolean check(String plain, String hash) {
|
||||
return BCrypt.checkpw(plain, hash);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user