| | |
| | | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; |
| | | import org.springframework.security.crypto.password.PasswordEncoder; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * @Author liuhaonan |
| | | * @Date 2022/2/24 10:15 |
| | |
| | | public class test { |
| | | public static void main(String[] args) { |
| | | |
| | | String s="e10adc3949ba59abbe56e057f20f883e"; |
| | | String s="123456";//$2a$10$t0t9gaLuWT/1XFDfbjbUueWcj2G/Dx5vQCrtyRKWNlqkz6C/y.oXK |
| | | PasswordEncoder pw= new BCryptPasswordEncoder(); |
| | | //加密 |
| | | String encode=pw.encode(s); |
| | |
| | | boolean matches=pw.matches(s,encode); |
| | | System.out.println("=============================="); |
| | | System.out.println(matches); |
| | | |
| | | // LocalDateTime now = LocalDateTime.now(); |
| | | // Integer week = now.getDayOfWeek().getValue(); |
| | | // System.out.println("获取当前周:" + week); |
| | | // |
| | | } |
| | | } |