MaskGenerationMethod.GenerateMask(Byte[], Int32) 方法

定义

当在派生类中重写时,使用指定的随机种子生成将具有指定长度的掩码。

C#
public abstract byte[] GenerateMask (byte[] rgbSeed, int cbReturn);
C#
[System.Runtime.InteropServices.ComVisible(true)]
public abstract byte[] GenerateMask (byte[] rgbSeed, int cbReturn);

参数

rgbSeed
Byte[]

用于计算掩码的随机种子。

cbReturn
Int32

生成的掩码长度(以字节为单位)。

返回

Byte[]

长度等于 cbReturn 参数的随机生成的掩码。

属性

示例

下面的代码示例演示如何重写 GenerateMask 以使用指定的种子创建和返回掩码。 此代码示例是为 MaskGenerationMethod 类提供的一个更大示例的一部分。

System.Security.Cryptography.MaskGenerationMethod#3

适用于

产品 版本
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1