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  

 

 

 

 

 

 

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 黃彥霖 的頭像
    黃彥霖

    彥霖 實驗筆記

    黃彥霖 發表在 痞客邦 留言(0) 人氣()