new operator entity

This commit is contained in:
Sola
2015-12-07 13:43:16 +08:00
parent bdf3cfe74e
commit b0ba46cc77
16 changed files with 212 additions and 145 deletions

View 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);
}
}