.net如何创建SHA1哈希?

lyn*_*ynn 3 .net sha1

是否有内置技术来做到这一点?它期望什么参数?

Gav*_*ler 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);
Run Code Online (Sandbox Code Playgroud)