Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

Data

Data: string | Buffer | ArrayBuffer

Represents input bytes as either a string, Buffer or ArrayBuffer. If data is a string - assumed encoding depends on the method the input is being passed to.

If data is Buffer, it is used as is, without copying.

If data is ArrayBuffer, the view of the ArrayBuffer will be created without copying the underlying memory.

Object literals

Const encoding

encoding: object

String decoding utilities.

base64ToBytes

  • base64ToBytes(str: string): Buffer
  • Decodes the base64-encoded string and returns Buffer.

    Parameters

    • str: string

      The string to decode.

    Returns Buffer

hexToBytes

  • hexToBytes(str: string): Buffer
  • Decodes the hex string and returns Buffer.

    Parameters

    • str: string

      The string to decode.

    Returns Buffer

stringToBytes

  • stringToBytes(str: string): Buffer
  • Decodes the utf8 string and returns Buffer.

    Parameters

    • str: string

      The string to decode.

    Returns Buffer