RandomNumberGenerator.GetHexString 方法

定義

多載

GetHexString(Int32, Boolean)

建立填入密碼編譯隨機十六進位字元的字串。

GetHexString(Span<Char>, Boolean)

使用密碼編譯隨機的十六進位字元填入緩衝區。

GetHexString(Int32, Boolean)

來源:
RandomNumberGenerator.cs
來源:
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)

來源:
RandomNumberGenerator.cs
來源:
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>) 和 指定十六進位字元做為選擇相同。 此實作特別針對十六進位字元進行優化。

適用於