Table of Contents

Class HexToken

Namespace
UglyToad.PdfPig.Tokens
Assembly
UglyToad.PdfPig.Tokens.dll

A token containing string data where the string is encoded as hexadecimal.

public class HexToken : IDataToken<string>, IToken, IEquatable<IToken>
Inheritance
HexToken
Implements
Inherited Members

Constructors

HexToken(IReadOnlyList<char>)

Create a new HexToken from the provided hex characters.

public HexToken(IReadOnlyList<char> characters)

Parameters

characters IReadOnlyList<char>

A set of hex characters 0-9, A - F, a - f representing a string.

Properties

Bytes

The bytes of the hex data.

public IReadOnlyList<byte> Bytes { get; }

Property Value

IReadOnlyList<byte>

Data

The string contained in the hex data.

public string Data { get; }

Property Value

string

Methods

Convert(char, char)

Convert two hex characters to a byte.

public static byte Convert(char high, char low)

Parameters

high char

The high nibble.

low char

The low nibble.

Returns

byte

The byte.

ConvertHexBytesToInt(HexToken)

Convert the bytes in this hex token to an integer.

public static int ConvertHexBytesToInt(HexToken token)

Parameters

token HexToken

The token containing the data to convert.

Returns

int

The integer corresponding to the bytes.

Equals(IToken)

public bool Equals(IToken obj)

Parameters

obj IToken

Returns

bool

GetHexString()

Converts the binary data back to a hex string representation.

public string GetHexString()

Returns

string