1.0.3 • Published 6 months ago

@ilihub/ascii v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

@ilihub/ascii

ASCII number system conversion typescript functions

NPM Version NPM CodeFactor Socket Badge

Installation

# if you're using pnpm
pnpm add @ilihub/ascii

# or, if you're using npm
npm install @ilihub/ascii

# or, if you're using yarn
yarn add @ilihub/ascii

Usage

import { Ascii } from "@ilihub/ascii";

const ascii = new Ascii("Hello World");

const binary = ascii.toBinary();
console.log(binary); // 01001000011001010110110001101100011011110010110000100000011101110110111101110010011011000110010000100001

const decimal = ascii.toDecimal();
console.log(decimal); // [ 72, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100, 33 ]

const hexadecimal = ascii.toHexadecimal();
console.log(hexadecimal); // 48656C6C6F2C20776F726C6421

const octal = ascii.toOctal();
console.log(octal); // 110145154154157054040167157162154144041

Sponsors & Backers

Support the development of new open-source projects from ilihub through crowdfunding.

The core of ilihub is our crowd-funded open-source projects, licensed under the permissive MIT license. Sponsorship increases the rate of bug fixes, documentation improvements, and feature development.

Sponsors