//MD5加密public String encrypt(String raw){String md5Str = raw;try {MessageDigest md = MessageDigest.getInstance("MD5");md.update(raw.getBytes());byte[]encryContext = md.digest();int i ;StringBuffer buf = new StringBuffer("");for (int offset = 0;offset < encryContext.length;offset++){i = encryContext[offset];if(i < 0){i += 256;}if(i < 16){buf.append("0");}buf.append(Integer.toHexString(i));}md5Str = buf.toString();}catch (NoSuchAlgorithmException e) {e.printStackTrace();}return md5Str.toUpperCase();}
快捷方法也可以直接使用okio加密