ars.module.people.assist.Passwords Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ars-module-people Show documentation
Show all versions of ars-module-people Show documentation
Ars framework module people
package ars.module.people.assist;
import org.springframework.security.crypto.password.StandardPasswordEncoder;
/**
* 密码操作工具类
*
* @author yongqiangwu
*
*/
public final class Passwords {
private static final StandardPasswordEncoder passwordEncoder = new StandardPasswordEncoder();
/**
* 明文加密
*
* @param express
* 明文
* @return 密文
*/
public static String encode(String express) {
return express == null ? null : passwordEncoder.encode(express);
}
/**
* 明文与密文是否相同
*
* @param express
* 明文
* @param password
* 密文
* @return true/false
*/
public static boolean matches(String express, String password) {
return express == null || password == null ? false : passwordEncoder.matches(express, password);
}
}