Socket
Socket
Sign inDemoInstall

any-to-any

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

any-to-any - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

1

dist/constants/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.__Error_InputNumber_Less_Than_InputBase__ = exports.__Error_InputNumber_Not_Special_Charts__ = exports.__Error_InputNumber_Int__ = exports.__Error_InputNumber_Size__ = exports.__Error_OutputBase__ = exports.__Error_InputBase__ = void 0;
exports.__Error_InputBase__ = 'Error InputBase : the input base should be between 2 et 36 ..';

@@ -4,0 +5,0 @@ exports.__Error_OutputBase__ = 'Error OutputBase : the output base should be between 2 et 36 ..';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.anyBaseToDecimal = void 0;
function anyBaseToDecimal(InputNumber, InputBase) {

@@ -4,0 +5,0 @@ let index = InputNumber.length - 1, result = 0, power = 1, unitConverted;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.decimalToAnyBase = void 0;
function decimalToAnyBase(InputNumber, OutputBase) {

@@ -4,0 +5,0 @@ let result = '', unitConverted, unitExtracted;

17

dist/conversion/index.js
"use strict";
/* root conversion 🥏 .. */
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./decimalToAnyBase"));
__export(require("./anyBaseToDecimal"));
__exportStar(require("./decimalToAnyBase"), exports);
__exportStar(require("./anyBaseToDecimal"), exports);
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = exports.Convert = void 0;
const conversion_1 = require("./conversion");

@@ -4,0 +5,0 @@ const validation_1 = require("./validation");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isValidInput = void 0;
const constants_1 = require("../constants");

@@ -4,0 +5,0 @@ function isValidInput(InputNumber, InputBase, OutputBase) {

{
"name": "any-to-any",
"version": "2.1.0",
"description": " convert numbers between bases ( any base to any base ) 🔀 .. ",
"version": "2.1.1",
"description": "Convert numbers between bases (any base to any base) 🔀",
"main": "dist/index.js",

@@ -6,0 +6,0 @@ "typings": "dist/index.d.ts",

@@ -42,2 +42,8 @@ # ANY-TO-ANY - converts numbers between bases ; binary , decimal , octal , hexadecimal and muche more ..

## `Limitation`
This module can convert only the integers numbers between base 2 & base 36.
**Soon, it will be possible to convert real numbers <small>[wip]</small>**
## `Installation`

@@ -58,29 +64,22 @@

```javascript
// const Convert = require ('any-to-any');
const { Convert } = require ('any-to-any');
// const Convert = require('any-to-any')
const { Convert } = require('any-to-any')
let InputNumber = '1110111'; // 119 in decimal
let InputBase = 2;
let OutputBase = 8;
const InputNumber = '1110111' // 119 in decimal
const InputBase = 2
const OutputBase = 8
let result = Convert (InputNumber, InputBase, OutputBase);
console.log(`*****\n ${result} \n*****`);
// $your_pc_name_with_your_directory
// *****
const result = Convert (InputNumber, InputBase, OutputBase)
console.log(result)
// 167
// *****
// NOTE: in case the input number is consists of numbers only,
// you can enter the number to the function in number type ..
let InputNumber = 1110111; // 119 in decimal
let InputBase = 2 ;
let OutputBase = 8 ;
let result = Convert ( InputNumber , InputBase , OutputBase );
console.log(`*****\n ${result} \n*****`);
const InputNumber = 1110111 // 119 in decimal
const InputBase = 2
const OutputBase = 8
const result = Convert (InputNumber, InputBase, OutputBase);
console.log(result);
// 167
// $your_pc_name_with_your_directory
// *****
// 167
// *****
```

@@ -91,11 +90,5 @@

## `Some Informations`
Switching between bases numbers is becoming easier with this module ..
This module can convert the integers numbers between base 2 & base 36 and soon it will be possible to convert real numbers ...
#### `License`
---
[MIT](LICENSE)
[MIT](LICENSE)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc