+6
-6
@@ -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') |
+1
-1
| { | ||
| "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": [ |
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
7029
0.5%1
Infinity%