MD5CryptoServiceProvider 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
注意
Derived cryptographic types are obsolete. Use the Create method on the base type instead.
MD5使用加密服务提供程序(CSP)提供的实现计算输入数据的哈希值。 此类不能被继承。
public ref class MD5CryptoServiceProvider sealed : System::Security::Cryptography::MD5
[System.Obsolete("Derived cryptographic types are obsolete. Use the Create method on the base type instead.", DiagnosticId="SYSLIB0021", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public sealed class MD5CryptoServiceProvider : System.Security.Cryptography.MD5
public sealed class MD5CryptoServiceProvider : System.Security.Cryptography.MD5
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class MD5CryptoServiceProvider : System.Security.Cryptography.MD5
[<System.Obsolete("Derived cryptographic types are obsolete. Use the Create method on the base type instead.", DiagnosticId="SYSLIB0021", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type MD5CryptoServiceProvider = class
inherit MD5
type MD5CryptoServiceProvider = class
inherit MD5
[<System.Runtime.InteropServices.ComVisible(true)>]
type MD5CryptoServiceProvider = class
inherit MD5
Public NotInheritable Class MD5CryptoServiceProvider
Inherits MD5
- 继承
- 属性
注解
哈希函数将任意长度的二进制字符串映射到固定长度的小二进制字符串。 加密哈希函数具有计算上不可行的属性,它无法找到哈希到同一值的不同输入;也就是说,如果相应的数据也匹配,则两组数据集的哈希应匹配。 对数据进行的少量更改会导致哈希中发生大量不可预知的更改。
注释
可以使用较新的哈希函数,例如安全哈希算法 SHA-256 和 SHA-512。 请考虑使用 SHA256 类或 SHA512 类而不是 MD5CryptoServiceProvider 类。 仅用于 MD5CryptoServiceProvider 与旧应用程序和数据的兼容性。
类的 MD5CryptoServiceProvider 哈希大小为 128 位。
ComputeHash类的方法MD5CryptoServiceProvider将哈希作为 16 个字节的数组返回。 请注意,某些 MD5 实现生成 32 个字符的十六进制格式哈希。 若要与此类实现互作,请设置方法的 ComputeHash 返回值的格式为十六进制值。
构造函数
| 名称 | 说明 |
|---|---|
| MD5CryptoServiceProvider() |
已过时.
初始化 MD5CryptoServiceProvider 类的新实例。 |
字段
| 名称 | 说明 |
|---|---|
| HashSizeInBits |
已过时.
MD5 算法生成的哈希大小(以位为单位)。 (继承自 MD5) |
| HashSizeInBytes |
已过时.
MD5 算法生成的哈希大小(以字节为单位)。 (继承自 MD5) |
| HashSizeValue |
已过时.
表示计算哈希代码的大小(以位为单位)。 (继承自 HashAlgorithm) |
| HashValue |
已过时.
表示计算的哈希代码的值。 (继承自 HashAlgorithm) |
| State |
已过时.
表示哈希计算的状态。 (继承自 HashAlgorithm) |
属性
| 名称 | 说明 |
|---|---|
| CanReuseTransform |
已过时.
获取一个值,该值指示是否可以重复使用当前转换。 (继承自 HashAlgorithm) |
| CanTransformMultipleBlocks |
已过时.
在派生类中重写时,获取一个值,该值指示是否可以转换多个块。 (继承自 HashAlgorithm) |
| Hash |
已过时.
获取计算的哈希代码的值。 (继承自 HashAlgorithm) |
| HashSize |
已过时.
获取计算哈希代码的大小(以位为单位)。 (继承自 HashAlgorithm) |
| InputBlockSize |
已过时.
在派生类中重写时,获取输入块大小。 (继承自 HashAlgorithm) |
| OutputBlockSize |
已过时.
在派生类中重写时,获取输出块大小。 (继承自 HashAlgorithm) |
方法
显式接口实现
| 名称 | 说明 |
|---|---|
| IDisposable.Dispose() |
已过时.
释放由托管资源使用 HashAlgorithm 的非托管资源,并选择性地释放托管资源。 (继承自 HashAlgorithm) |