Class Hex
Class for encoding and decoding bytes into base-16 encoded text, otherwise known as hexadecimal.
public class Hex : Base16, ITextEncoding
- Inheritance
-
objectHex
- Implements
- Inherited Members
Remarks
This class is an alias for Base16. New code should use that class
Methods
BytesToHex(ReadOnlySpan<byte>)
Encode the byte collection into a string representation.
public static string BytesToHex(ReadOnlySpan<byte> bytes)
Parameters
bytes
ReadOnlySpan<byte>
Returns
- string
A string representation of
data
.
HexToBytes(string)
Decode the string into a byte array.
public static byte[] HexToBytes(string encoded)
Parameters
encoded
stringA string encoded with data to be decoded.
Returns
- byte[]
A byte collection resulting from decoding
encoded
.