BCryptPasswordEncoder加密及判断密码是否相同

public class PwdEncoder {
    public static void main(String[] args) {
        PasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
        IntStream.range(0, 10).forEach(index -> {
            String encodeText = passwordEncoder.encode("123456");
            System.out.println(encodeText);
            boolean matches = passwordEncoder.matches("123456", encodeText);
            System.out.println(matches);
        });
    }
}

 

 

你可能感兴趣的:(BCryptPasswordEncoder加密及判断密码是否相同)