java
Cai_javaXiaoFan
这个作者很懒,什么都没留下…
展开
-
spring security的checkpw加密和对密码验证的原理
为何每次不同的 密码盐值 却可以校验成功的 关键public static void main(String[] args) { String hashpw = BCrypt.hashpw("123", BCrypt.gensalt()); System.out.println(hashpw); System.out.println(BCrypt.checkpw("123", "$2a$10$4uRhi/76ixeg7KS4p5tf7O3wGKNj1E.原创 2020-12-24 11:02:20 · 1231 阅读 · 1 评论 -
java 通过月份 取到上个月份
public static String getPreMonth(String date) throws ParseException { SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM"); Date currentDate = sd.parse(date); Calendar cal = Calendar.getInstance(); cal.setTime(currentDate).原创 2020-09-09 15:15:45 · 593 阅读 · 0 评论