Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

base-conv

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

base-conv - npm Package Compare versions

Comparing version 1.2.2 to 1.3.0

4

index.js
'use strict';
let CHARSET = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
let CHARSET = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_';
let CHARSET_MAP; // char => position map, to avoid calling indexOf

@@ -24,3 +24,3 @@

const convert = (_str = '', src_base = 10, dst_base = CHARSET.length, safe) => {
if (dst_base > CHARSET.length) throw new Error(`src or dst radix exceeds current charset length (${CHARSET.length})`);
if (dst_base > CHARSET.length) throw new Error(`dst radix exceeds current charset length (${CHARSET.length})`);

@@ -27,0 +27,0 @@ const res = [];

{
"name": "base-conv",
"version": "1.2.2",
"version": "1.3.0",
"description": "Convert arbitrarily big numbers from any radix representation to any other",

@@ -36,6 +36,6 @@ "main": "index.js",

"@std/esm": "^0.26.0",
"codecov": "^3.0.3",
"nyc": "^12.0.2",
"rollup": "^0.62.0"
"codecov": "^3.1.0",
"nyc": "^13.0.1",
"rollup": "^0.66.0"
}
}

@@ -7,3 +7,3 @@ # radix conversion

- default charset is `'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'` (base62)
- default charset is `'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_'`
- you can change it with `conv.setCharset`

@@ -17,3 +17,3 @@ - no IEEE-754 limitation

console.log(conv('42', 10, 16)) // '2a'
console.log(conv('42'.repeat(100), 10, 16)) // '8DE2991DF40FF7830578100...'
console.log(conv('42'.repeat(100), 10, 16)) // '8de2991df40ff783057818d0012f3bc1c...'
```

@@ -20,0 +20,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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