Crypto.GenerateRandomBytes Method

生成随机字节数据。

Definition

Namespace: QuickAdmin.Utils
Assembly: QuickAdmin.Net (in QuickAdmin.Net.dll) Version: 1.2.4
C#
public static byte[] GenerateRandomBytes(
	int size = 16,
	bool nonZero = false
)

Parameters

size  int  (Optional)
指示生成数据的大小,单位为字节。
nonZero  bool  (Optional)
指示生成的字节数据是否全部为非零值。

Return Value

byte[]
一个大小为 size 的字节数组。

Exceptions

ArgumentExceptionsize 小于或等于零。

See Also