using System.Security.Cryptography; // 記得匯入
FileStream f = new FileStream("C:/A.png", FileMode.Open);
MD5 m = MD5.Create();
byte [] hashb = m.ComputeHash(f);
f.Close();
string sm = "";
for(int k = 0; k < hashb.Length; k++){
sm += hashb[k] + " ";
}
print("MD5 : " + sm);
輸出結果(每個檔案都不一樣):
MD5 : 249 250 124 156 29 54 224 142 46 126 64 243 218 95 142 38
全站熱搜