下載下傳jar包:https://pan.baidu.com/s/1TxnW8DqEgRvIL4Urqlnzyw
線上回複密碼:QQ1085220040
把jar包添加到libs下并且add as Lib
public String EncoderByMd5(String str) throws NoSuchAlgorithmException,
UnsupportedEncodingException {
// 确定計算方法
MessageDigest md5 = MessageDigest.getInstance("MD5");
BASE64Encoder base64en = new BASE64Encoder();
// 加密後的字元串
String newstr = base64en.encode(md5.digest(str.getBytes("utf-8")));
return newstr;
}
或者自定義BASE64Encoder
https://blog..net/meixi_android/article/details/80893252