@protobufjs/base64
Advanced tools
Comparing version 1.0.1 to 1.0.2
18
index.js
@@ -26,9 +26,11 @@ "use strict"; | ||
// Base64 encoding table | ||
var b64 = [ | ||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, | ||
81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, | ||
103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, | ||
119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47 | ||
]; | ||
var b64 = []; | ||
// Base64 decoding table | ||
var s64 = []; | ||
// 65..90, 97..122, 48..57, 43, 47 | ||
for (var i = 0; i < 64;) | ||
s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++; | ||
/** | ||
@@ -42,3 +44,3 @@ * Encodes a buffer to a base64 encoded string. | ||
base64.encode = function encode(buffer, start, end) { | ||
var string = new Array(Math.ceil((end - start) / 3) * 4); | ||
var string = []; // alt: new Array(Math.ceil((end - start) / 3) * 4); | ||
var i = 0, // output index | ||
@@ -76,4 +78,2 @@ j = 0, // goto index | ||
// Base64 decoding table | ||
var s64 = []; for (var i = 0; i < b64.length; ++i) s64[b64[i]] = i; | ||
var invalidEncoding = "invalid encoding"; | ||
@@ -80,0 +80,0 @@ |
{ | ||
"name": "@protobufjs/base64", | ||
"description": "A minimal base64 implementation for number arrays.", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"author": "Daniel Wirtz <dcode+protobufjs@dcode.io>", | ||
@@ -6,0 +6,0 @@ "repository": { |
Copyleft License
License(Experimental) Copyleft license information was found
Found 1 instance in 1 package
No License Found
License(Experimental) License information could not be found
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
15919
3
112