Home Reference Source
import {BinaryUtils} from 'rabbit-hole'
public class | source

BinaryUtils

A collection of binary number utilities.

Static Method Summary

Static Public Methods
public static

Creates a binary string representation of the given number.

public static

Interpretes the given string as a binary number.

Static Public Methods

public static createBinaryString(n: Number, minBits: Number): String source

Creates a binary string representation of the given number.

Params:

NameTypeAttributeDescription
n Number

A number.

minBits Number
  • optional
  • default: 64

The minimum length of the string.

Return:

String

The binary representation.

public static parseBin(s: String): Number source

Interpretes the given string as a binary number.

Params:

NameTypeAttributeDescription
s String

A string that represents a binary number.

Return:

Number

The parsed number.