由於消息摘要唯一性和不可逆性的特點
package test;
import java
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c)
* <p>Company: </p>
* @author unascribed
* @version
*/
public class StringUtil {
private final static String[] hexDigits = {
/**
* 轉換字節數組為
* @param b 字節數組
* @return
*/
public static String byteArrayToHexString(byte[] b) {
StringBuffer resultSb = new StringBuffer();
for (int i =
resultSb
}
return resultSb
}
private static String byteToHexString(byte b) {
int n = b;
if (n <
n =
int d
int d
return hexDigits[d
}
public static String MD
String resultString = null;
try {
resultString=new String(origin);
MessageDigest md = MessageDigest
resultString=byteArrayToHexString(md
}
catch (Exception ex) {
}
return resultString;
}
public static void main(String[] args){
System
}
}
在RFC
MD
MD
MD
MD
MD
From:http://tw.wingwit.com/Article/program/Java/Javascript/201311/25434.html