package com.ningdatech.pmapi.password;

import org.junit.Test;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

/**
 * @Classname PasswordTest
 * @Description
 * @Date 2023/8/2 17:39
 * @Author PoffyZhang
 */
public class PasswordTest {

    @Test
    public void password(){
        String mingwen = "ELgaCeHteZA8VJK8";

        String miwen = "$2a$10$MT82RbInrIkRVL/GRS01Vew8AO6ICngOpbAGbdkWgSnYFhog5n8.q";

        String encode = new BCryptPasswordEncoder().encode(mingwen);
        boolean matches = new BCryptPasswordEncoder().matches(mingwen, encode);
        System.out.println(encode);
        System.out.println(matches);
    }
}
