Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
GetHexString(Int32, Boolean) |
Creates a string filled with cryptographically random hexadecimal characters. |
GetHexString(Span<Char>, Boolean) |
Fills a buffer with cryptographically random hexadecimal characters. |
Creates a string filled with cryptographically random hexadecimal characters.
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
The length of string to create.
true
if the hexadecimal characters should be lowercase; false
if they should be uppercase.
The default is false
.
A string populated with random hexadecimal characters.
The behavior of this is the same as using GetString(ReadOnlySpan<Char>, Int32) and specifying hexadecimal characters as the choices. This implementation is optimized specifically for hexadecimal characters.
Product | Versions |
---|---|
.NET | 8, 9, 10 |
Fills a buffer with cryptographically random hexadecimal characters.
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)
true
if the hexadecimal characters should be lowercase; false
if they should be uppercase.
The default is false
.
The behavior of this is the same as using GetItems<T>(ReadOnlySpan<T>, Span<T>) and specifying hexadecimal characters as the choices. This implementation is optimized specifically for hexadecimal characters.
Product | Versions |
---|---|
.NET | 8, 9, 10 |
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in