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": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7029
1