Socket
Socket
Sign inDemoInstall

base-x

Package Overview
Dependencies
1
Maintainers
4
Versions
24
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.7 to 3.0.8

2

package.json
{
"name": "base-x",
"version": "3.0.7",
"version": "3.0.8",
"description": "Fast base encoding / decoding of any given alphabet",

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

@@ -6,3 +6,3 @@ /// <reference types="node" />

interface BaseConverter {
encode(buffer: Buffer): string;
encode(buffer: Buffer | number[] | Uint8Array): string;
decodeUnsafe(string: string): Buffer | undefined;

@@ -9,0 +9,0 @@ decode(string: string): Buffer;

@@ -12,3 +12,5 @@ 'use strict'

var BASE_MAP = new Uint8Array(256)
BASE_MAP.fill(255)
for (var j = 0; j < BASE_MAP.length; j++) {
BASE_MAP[j] = 255
}
for (var i = 0; i < ALPHABET.length; i++) {

@@ -25,2 +27,3 @@ var x = ALPHABET.charAt(i)

function encode (source) {
if (Array.isArray(source) || source instanceof Uint8Array) { source = _Buffer.from(source) }
if (!_Buffer.isBuffer(source)) { throw new TypeError('Expected Buffer') }

@@ -27,0 +30,0 @@ if (source.length === 0) { return '' }

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc