DotNext by .NET Foundation and Contributors

<PackageReference Include="DotNext" Version="5.17.0" />

 Hex

public static class Hex
Provides conversion to/from hexadecimal representation.
public static int DecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> output)

Decodes hexadecimal representation of bytes.

public static int DecodeFromUtf8(ReadOnlySpan<byte> chars, Span<byte> output)

Decodes hexadecimal representation of bytes.

public static int EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> output, bool lowercased = false)

Converts set of bytes into hexadecimal representation.

public static string EncodeToUtf16(ReadOnlySpan<byte> bytes, bool lowercased = false)

Converts set of bytes into hexadecimal representation.

public static int EncodeToUtf8(ReadOnlySpan<byte> bytes, Span<byte> output, bool lowercased = false)

Converts set of bytes into hexadecimal representation.

public static byte[] EncodeToUtf8(ReadOnlySpan<byte> bytes, bool lowercased = false)

Converts set of bytes into hexadecimal representation.