mirror of
https://github.com/ZSCNetSupportDept/WechatTicketSystem.git
synced 2025-10-29 08:05:04 +08:00
update to j8
This commit is contained in:
27
src/test/java/love/sola/netsupport/wechat/TestEncrypt.java
Normal file
27
src/test/java/love/sola/netsupport/wechat/TestEncrypt.java
Normal file
@@ -0,0 +1,27 @@
|
||||
package love.sola.netsupport.wechat;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.mindrot.jbcrypt.BCrypt;
|
||||
|
||||
/**
|
||||
* ***********************************************
|
||||
* Created by Sola on 2015/12/6.
|
||||
* Don't modify this source without my agreement
|
||||
* ***********************************************
|
||||
*/
|
||||
public class TestEncrypt {
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
String hash = BCrypt.hashpw("mypasswordhere", BCrypt.gensalt());
|
||||
System.out.println("hash = " + hash);
|
||||
System.out.println("BCrypt.checkpw(\"mypasswordhere\",hash) = " + BCrypt.checkpw("mypasswordhere", hash));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testChk() {
|
||||
String hash = "$2a$10$RCXxfEygwHQeF4BKjx5Uwu/C72HqoCN.jKpNSNdwizcy7m301C9Am";
|
||||
System.out.println("BCrypt.checkpw(\"mypasswordhere\",hash) = " + BCrypt.checkpw("mypasswordhere", hash));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user