Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "BinaryUtils"

Index

Functions

bigIntegerNumberToBinaryString

  • bigIntegerNumberToBinaryString(num: BigInteger): string
  • Converts a given BigInteger number to a binary string

    Parameters

    • num: BigInteger

      the BigInteger number

    Returns string

    the binary string

decimalNumberToBinaryString

  • decimalNumberToBinaryString(num: number): string
  • Converts a decimal number to binary string

    Parameters

    • num: number

      number to parse

    Returns string

    the binary string representation of number

decimalNumberToOctetString

  • decimalNumberToOctetString(num: number): string
  • Converts a decimal number to binary octet (8 bit) string. If needed the octet will be padded with zeros to make it up to 8 bits

    Parameters

    • num: number

      to convert to octet string

    Returns string

    the octet string representation of given number

dottedDecimalNotationToBinaryString

  • dottedDecimalNotationToBinaryString(dottedDecimal: string): string
  • Given an IPv4 number in dot-decimal notated string, e.g 192.168.0.1 converts it to binary string, e.g. '11000000101010000000000000000001'

    Parameters

    • dottedDecimal: string

      IPv4 string in dot-decimal notation

    Returns string

    the binary value of the given ipv4 number in string

leftPadWithZeroBit

  • leftPadWithZeroBit(binaryString: string, finalStringLength: number): string
  • Given a binary string, adds a number of zero to the left until string is as long as the given string length

    Parameters

    • binaryString: string

      the string to pad

    • finalStringLength: number

      the final length of string after padding

    Returns string

parseBinaryStringToBigInteger

  • parseBinaryStringToBigInteger(num: string): BigInteger
  • Parses number in binary to number in BigInteger

    Parameters

    • num: string

      binary number in string to parse

    Returns BigInteger

    binary number in BigInteger

Generated using TypeDoc