Table of Contents

Class Hex

Namespace
Yubico.Core.Buffers
Assembly
Yubico.Core.dll

Class for encoding and decoding bytes into base-16 encoded text, otherwise known as hexadecimal.

public class Hex : Base16, ITextEncoding
Inheritance
object
Hex
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 string

A string encoded with data to be decoded.

Returns

byte[]

A byte collection resulting from decoding encoded.