1.0.2 • Published 2 years ago

quadconv v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

QuadConv

Make quick and easy conversions between Decimal, ASCII, Binary, and Hexadecimal!

Install

Install QuadConv via NPM

$ npm i quadconv

or

$ npm install quadconv

Use

const QuadConv = require("quadconv");

// returns converted string
// returns "null", "NaN", or "" if there's an issue with conversion
QuadConv.convert(conversion, input);

or

const QuadConv = require("quadconv");

// returns converted string
// throws an error if there's an issue with conversion
QuadConv.convert(conversion, input, true);

Key

QuadConv.convert('[input type]-[output type]', '[input]', boolean);

Input/Output Types \ dec - Decimal \ asc - ASCII \ bin - Binary \ hex - Hexadecimal

Boolean (true/false) \ true - throw an Error if there's an issue with conversion false - return null/NaN/empty string if there's an issue with conversion

Examples

// converts ASCII to Decimal
// returns '104 101 108 108 111 32 119 111 114 108 100'
QuadConv.convert('asc-dec', 'hello world');

// converts Binary to Hexadecimal
// returns '68 69 21'
QuadConv.convert('bin-hex', '1101000 1101001 100001');

// converts Decimal to Binary
// returns '111000'
QuadConv.convert('dec-bin', '56');

Contact

Discord: Nic#5418 \ Email: niccheng27@gmail.com