.net如何创建SHA1哈希?

时间:2009-03-05 18:29:39

标签: .net sha1

是否有内置技术可以做到这一点?它期望什么论点?

1 个答案:

答案 0 :(得分:7)

MSDN

byte[] data = new byte[DATA_SIZE];
byte[] result; 

SHA1 sha = new SHA1CryptoServiceProvider(); 
// This is one implementation of the abstract class SHA1.
result = sha.ComputeHash(data);