Class HexBytes

Represents a collection of bytes stored as a Uint8Array with methods to convert to/from hexadecimal and JSON.

Hierarchy

  • HexBytes

Constructors

Properties

Methods

Constructors

Properties

bytes: Uint8Array

The raw byte data stored in a Uint8Array.

Methods

  • Converts the stored bytes into a hexadecimal string.

    Returns

    The hexadecimal string representation of the byte data.

    Returns string

  • Converts the stored bytes to a JSON string representation. This method returns the hexadecimal string of the byte data.

    Returns

    The hexadecimal string as a JSON string.

    Returns string

  • Returns a string representation of the byte data as hexadecimal.

    Returns

    A string representing the byte data in hexadecimal format.

    Returns string

  • Creates a HexBytes instance from a hexadecimal string.

    Returns

    A new HexBytes instance.

    Parameters

    • hexString: string

      The hexadecimal string to convert.

    Returns HexBytes

  • Creates a HexBytes instance from a JSON string. The JSON string should be a hexadecimal string.

    Returns

    A new HexBytes instance.

    Parameters

    • json: string

      The JSON string to convert.

    Returns HexBytes

Generated using TypeDoc