Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "util"

Index

Functions

reverse

  • reverse(str: string): string
  • Takes a string, reverses it and returns the result.

    Parameters

    • str: string

      String to reverse

    Returns string

    The input string reversed

toHex

  • toHex(byte: number): string
  • Converts a given number to hexadecimal notation with leading '0x'. If the given number is less than 16, a leading zero is appended to the output.

    Parameters

    • byte: number

      Number to convert to hex

    Returns string

    A hex string corresponding to the input number

toPaddedBinary

  • toPaddedBinary(num: number): string
  • Takes a number, converts it to binary and makes sure it is padded to a length of 8 (i.e. a byte). If the input is longer than 8 digits in binary, it is returned unchanged.

    Parameters

    • num: number

      Number to be converted

    Returns string

    Binary number as a string of length 8

Generated using TypeDoc