Options
All
  • Public
  • Public/Protected
  • All
Menu

Package common

@stacks/common

Common utilities used by Stacks.js packages.

Installation

npm install @stacks/common

Index

Type Aliases

IntegerType: number | string | bigint | Uint8Array | BN

Variables

Buffer: typeof NodeJSBuffer = ...

Functions

  • getBase64OutputLength(inputByteLength: number): number
  • Calculate the base64 encoded string length for a given input length. This is equivalent to the byte length when the string is ASCII or UTF8-8 encoded.

    Parameters

    • inputByteLength: number

    Returns number

  • intToBigInt(value: IntegerType, signed: boolean): bigint
  • Parameters

    Returns bigint

  • intToBytes(value: IntegerType, signed: boolean, byteLength: number): Buffer
  • Parameters

    Returns Buffer

  • toBuffer(value: bigint, length?: number): Buffer
  • Converts bigint to buffer type

    Parameters

    • value: bigint
    • length: number = 16

    Returns Buffer

    buffer instance in big endian format

  • with0x(value: string): string
  • Parameters

    • value: string

    Returns string

Generated using TypeDoc