Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace utils

Index

Functions

  • bytesToHex(bytes: Uint8Array): string
  • Convert byte array to hex string (no 0x prefix).

    Parameters

    • bytes: Uint8Array

    Returns string

  • bytesToUtf8(b: Uint8Array): string
  • Decode byte array to utf-8 string.

    Parameters

    • b: Uint8Array

    Returns string

  • hexToBytes(hex: string | Uint8Array): Uint8Array
  • Convert input to a byte array.

    Handles both 0x prefixed and non-prefixed strings.

    Parameters

    • hex: string | Uint8Array

    Returns Uint8Array

  • utf8ToBytes(s: string): Uint8Array
  • Encode utf-8 string to byte array.

    Parameters

    • s: string

    Returns Uint8Array

Generated using TypeDoc