md5盐值混淆加密
程序员文章站
2024-03-19 11:50:52
...
/**
* @author minghai
* @description 测试MD5加密
* @date 2019/11/19
*/
public class TestMd5 {
public final String slat = "kajfajfkajeiraf*jkfja^&fakjf^#[email protected]%jfaie%";
public String getMd5(int id){
String base = id + slat;
// 使用spring的工具类进加密
String md5 = DigestUtils.md5DigestAsHex(base.getBytes());
return md5;
}
@Test
public void test(){
int id = 100;
String md5 = getMd5(id);
//88e72a1def10dc47533e25d12c09dbc3
System.out.println(md5);
}
}