Edit

Share via


Random.GetHexString Method

Definition

Overloads

GetHexString(Int32, Boolean)

Creates a string filled with random hexadecimal characters.

GetHexString(Span<Char>, Boolean)

Fills a buffer with random hexadecimal characters.

GetHexString(Int32, Boolean)

Source:
Random.cs

Creates a string filled with random hexadecimal characters.

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

Parameters

stringLength
Int32

The length of string to create.

lowercase
Boolean

true if the hexadecimal characters should be lowercase; false if they should be uppercase.

The default is false.

Returns

A string populated with random hexadecimal characters.

Applies to

GetHexString(Span<Char>, Boolean)

Source:
Random.cs

Fills a buffer with random hexadecimal characters.

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

Parameters

destination
Span<Char>

The buffer to receive the characters.

lowercase
Boolean

true if the hexadecimal characters should be lowercase; false if they should be uppercase.

The default is false.

Applies to