All Downloads are FREE. Search and download functionalities are using the official Maven repository.

club.zhcs.lina.auth.encode.PasswordMatcher Maven / Gradle / Ivy

package club.zhcs.lina.auth.encode;

/**
 * 
 * @author Kerbores([email protected])
 *
 */
public interface PasswordMatcher {

    /**
     * 加密
     * 
     * @param raw
     *            明文
     * @return 密文
     */
    public default String encode(String raw) {
        return PasswordUtils.randomSaltEncode(raw, 5);
    }

    /**
     * 比对
     * 
     * @param raw
     *            明文
     * @param encoded
     *            密文
     * @return 是否匹配
     */
    public default boolean match(String raw, String encoded) {
        return PasswordUtils.randomSaltVerify(raw, encoded, 5);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy