JAVA的BCrypt密码加密实现
示例: String hashed = BCrypt.hashpw("111111", BCrypt.gensalt()); System.out.println(hashed); //产生因子2,默认10 hashed = BCrypt.hashpw("111111", BCrypt.gensalt(12)); System.out.println(hashed); // Check that an unencrypted password matches one that has // previously been hashed if (BCrypt.checkpw("111111", hashed)) System.out.println("It matches"); else System.out.println("It does not match");
用户评论
谢谢分享,很好的东西!
很好,可以用,学习到了