Share via


RandomNumberGenerator.GetHexString 方法

定义

重载

GetHexString(Int32, Boolean)

创建一个用加密随机十六进制字符填充的字符串。

GetHexString(Span<Char>, Boolean)

使用加密随机十六进制字符填充缓冲区。

GetHexString(Int32, Boolean)

Source:
RandomNumberGenerator.cs
Source:
RandomNumberGenerator.cs

创建一个用加密随机十六进制字符填充的字符串。

public static string GetHexString (int stringLength, bool lowercase = false);
static member GetHexString : int * bool -> string
Public Shared Function GetHexString (stringLength As Integer, Optional lowercase As Boolean = false) As String

参数

stringLength
Int32

要创建的字符串的长度。

lowercase
Boolean

true 如果十六进制字符应为小写,则为 ; false 如果它们应为大写,则为 。 默认为 false

返回

用随机十六进制字符填充的字符串。

注解

此操作的行为与使用 GetString(ReadOnlySpan<Char>, Int32) 并将十六进制字符指定为选项相同。 此实现专门针对十六进制字符进行优化。

适用于

GetHexString(Span<Char>, Boolean)

Source:
RandomNumberGenerator.cs
Source:
RandomNumberGenerator.cs

使用加密随机十六进制字符填充缓冲区。

public static void GetHexString (Span<char> destination, bool lowercase = false);
static member GetHexString : Span<char> * bool -> unit
Public Shared Sub GetHexString (destination As Span(Of Char), Optional lowercase As Boolean = false)

参数

destination
Span<Char>

要接收字符的缓冲区。

lowercase
Boolean

true 如果十六进制字符应为小写,则为 ; false 如果它们应为大写,则为 。 默认为 false

注解

此操作的行为与使用 GetItems<T>(ReadOnlySpan<T>, Span<T>) 并将十六进制字符指定为选项相同。 此实现专门针对十六进制字符进行优化。

适用于