UNPKG

@zodash/basex

Version:

Simple Covert value to binary | hex | base62 | base36 | basex | customAlphabet

22 lines (21 loc) 551 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const customAlphabet_1 = require("./customAlphabet"); // @raw // export default function binary(num: number): string { // const arr = []; // const radix = 2; // let mod: number; // let value = num; // do { // mod = value % radix; // value = (value - mod) / radix; // arr.unshift(mod); // } while (value); // return arr.join(''); // } const fn = customAlphabet_1.default('01'); function binary(num) { return fn(num); } exports.default = binary;