1、MD5加密
/** * @Auther: acer * @Date: 2019/4/6 10:34 * @Description: 加密工具类 */ public class EncryptUtil { //MD5加密 public static String encodeMD5(String val) throws Exception{ //初始化MessageDigest MessageDigest md = MessageDigest.getInstance("MD5"); // 执行消息摘要 byte[] digest = md.digest(val.getBytes()); return new String(Hex.encode(digest)); } }