Class HexToken
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
Data
The string contained in the hex data.
public string Data { get; }
Property Value
Methods
Convert(char, char)
Convert two hex characters to a byte.
public static byte Convert(char high, char low)
Parameters
Returns
- byte
The byte.
ConvertHexBytesToInt(HexToken)
Convert the bytes in this hex token to an integer.
public static int ConvertHexBytesToInt(HexToken token)
Parameters
token
HexTokenThe 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
GetHexString()
Converts the binary data back to a hex string representation.
public string GetHexString()