语言

Hash.GenerateHash(HashAlgorithm) 方法

定义

使用指定的哈希算法计算程序集的哈希值。

public:
 cli::array <System::Byte> ^ GenerateHash(System::Security::Cryptography::HashAlgorithm ^ hashAlg);
public byte[] GenerateHash(System.Security.Cryptography.HashAlgorithm hashAlg);
member this.GenerateHash : System.Security.Cryptography.HashAlgorithm -> byte[]
Public Function GenerateHash (hashAlg As HashAlgorithm) As Byte()

参数

hashAlg
HashAlgorithm

用于计算程序集哈希值的哈希算法。

返回

Byte[]

一个字节数组,表示程序集的哈希值。

例外

参数 hashAlg 为 null.

无法生成程序集的哈希值。

注解

类构造函数中指定的程序集提供用于计算哈希值的字节。 参数 hashAlg 是派生自特定 HashAlgorithm对象。 返回的哈希值的类型由 hashAlg.

适用于