com.tmsps.ne4springboot.util.MD5Util Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ne4SpringBoot Show documentation
Show all versions of ne4SpringBoot Show documentation
NE For SpringBoot is good :)
package com.tmsps.ne4springboot.util;
import org.springframework.util.DigestUtils;
/**
* MD加密工具
*
* @author zhangwei
*
*/
public class MD5Util {
private static final String MD5_SALT = "NE_CORE";
/**
*======================================================
* @author zhangwei [email protected]
*------------------------------------------------------
* add salt
*======================================================
*/
public static String MD5(final String str, final String salt) {
return DigestUtils.md5DigestAsHex(str.concat(salt).getBytes());
}
public static String MD5(final String str) {
return MD5(str, MD5_SALT);
}
/**
* Normal md5
*/
public static String MD5Normal(final String str) {
return DigestUtils.md5DigestAsHex(str.getBytes());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy