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

base-x

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

base-x - npm Package Compare versions

Comparing version 1.1.0 to 2.0.0

12

index.js

@@ -15,4 +15,4 @@ // base-x encoding

// pre-compute lookup table
for (var i = 0; i < ALPHABET.length; i++) {
ALPHABET_MAP[ALPHABET.charAt(i)] = i
for (var z = 0; z < ALPHABET.length; z++) {
ALPHABET_MAP[ALPHABET.charAt(z)] = z
}

@@ -48,3 +48,3 @@

function decodeUnsafe (string) {
if (string.length === 0) return []
if (string.length === 0) return Buffer.allocUnsafe(0)

@@ -73,8 +73,8 @@ var bytes = [0]

return bytes.reverse()
return Buffer.from(bytes.reverse())
}
function decode (string) {
var array = decodeUnsafe(string)
if (array) return array
var buffer = decodeUnsafe(string)
if (buffer) return buffer

@@ -81,0 +81,0 @@ throw new Error('Non-base' + BASE + ' character')

{
"name": "base-x",
"version": "1.1.0",
"version": "2.0.0",
"description": "Fast base encoding / decoding of any given alphabet",

@@ -5,0 +5,0 @@ "keywords": [

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