1.1.15 • Published 4 years ago

dhb-converter v1.1.15

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

dhb-converter

This package will be used to convert a bases numbers 10, 2, or 16 to binary for (10 and 16) and hexadecimal (for 2 and 10)

Contact me

If you have any questions do not hesitate to join me on my discord server

API

  • convert.decimalToBinary()
  • convert.decimalToHexadecimal()
  • convert.binaryToHexadecimal()
  • convert.binaryToDecimal()
  • convert.hexadecimalToBin()
  • convert.hexadecimalToDecimal()

Convert the hexadecimal code to decimal

const { convert } = require('dhb-converter');
const x = 50;
const value = convert.hexadecimalToDecimal(x);

/*
* Now let's use our funtion
*/

console.log(value); /* () => For this exemple "x = 50", so the answer is 80 */

Convert the decimal to hexadecimal code

const { convert } = require('dhb-converter');
const x = 50;
const value = convert.decimalToHexadecimal(x);

console.log(value); /* () => For this exemple "x = 50", so the answer is 32 */

Convert the decimal to binary code

const { convert } = require('dhb-converter');
const x = 50;
const value = convert.decimalToBinary(x);

console.log(value); /* () => For this exemple "x = 50", so the answer is 110010 */

Convert the binary code to hexadecimal code

const { convert } = require('dhb-converter');
const x = 110010;
const value = convert.binaryToHexadecimal(x);

console.log(value); /* () => For this exemple "x = 110010", so the answer is 32 */

Convert the binary code to decimal

const { convert } = require('dhb-converter');
const x = 110010;
const value = convert.binaryToDecimal(x);

console.log(value); /* () => For this exemple "x = 110010", so the answer is 50 */

Convert the binary code to hexadecimal code

const { convert } = require('dhb-converter');
const x = 110010;
const value = convert.binaryToHexadecimal(x);

console.log(value); /* () => For this exemple "x = 110010", so the answer is 32 */

Convert the hexadecimal code to binary code

const { convert } = require('dhb-converter');
const x = 32;
const value = convert.hexadecimalToBinary(x);

console.log(value); /* () => For this exemple "x = 32", so the answer is 110010 */

MIT License

Copyright (c) 2019 wazabix

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

1.1.15

4 years ago

1.1.14

4 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago