spring自带md5加密工具类

 1. 导包

import org.springframework.util.DigestUtils;
        String password = "123456";
        password = DigestUtils.md5DigestAsHex(password.getBytes());
        System.out.println("password = " + password);

2. 效果

password = e10adc3949ba59abbe56e057f20f883e

 

你可能感兴趣的:(Java,spring,java,前端)