🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

js-base64

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-base64 - npm Package Compare versions

Comparing version
3.7.7
to
3.7.8
+4
-4
base64.d.mts

@@ -12,7 +12,7 @@ /**

*/
declare const version = "3.7.7";
declare const version = "3.7.8";
/**
* @deprecated use lowercase `version`.
*/
declare const VERSION = "3.7.7";
declare const VERSION = "3.7.8";
/**

@@ -81,3 +81,3 @@ * polyfill version of `btoa`

*/
declare const isValid: (src: any) => boolean;
declare const isValid: (src: unknown) => boolean;
/**

@@ -110,3 +110,3 @@ * extend String.prototype with relevant methods

decode: (src: string) => string;
isValid: (src: any) => boolean;
isValid: (src: unknown) => boolean;
fromUint8Array: (u8a: Uint8Array, urlsafe?: boolean) => string;

@@ -113,0 +113,0 @@ toUint8Array: (a: string) => Uint8Array;

@@ -12,7 +12,7 @@ /**

*/
declare const version = "3.7.7";
declare const version = "3.7.8";
/**
* @deprecated use lowercase `version`.
*/
declare const VERSION = "3.7.7";
declare const VERSION = "3.7.8";
/**

@@ -81,3 +81,3 @@ * polyfill version of `btoa`

*/
declare const isValid: (src: any) => boolean;
declare const isValid: (src: unknown) => boolean;
/**

@@ -110,3 +110,3 @@ * extend String.prototype with relevant methods

decode: (src: string) => string;
isValid: (src: any) => boolean;
isValid: (src: unknown) => boolean;
fromUint8Array: (u8a: Uint8Array, urlsafe?: boolean) => string;

@@ -113,0 +113,0 @@ toUint8Array: (a: string) => Uint8Array;

@@ -40,3 +40,3 @@ //

*/
var version = '3.7.7';
var version = '3.7.8';
/**

@@ -201,3 +201,4 @@ * @deprecated use lowercase `version`.

asc += '=='.slice(2 - (asc.length & 3));
var u24, bin = '', r1, r2;
var u24, r1, r2;
var binArray = []; // use array to avoid minor gc in loop
for (var i = 0; i < asc.length;) {

@@ -208,7 +209,13 @@ u24 = b64tab[asc.charAt(i++)] << 18

| (r2 = b64tab[asc.charAt(i++)]);
bin += r1 === 64 ? _fromCC(u24 >> 16 & 255)
: r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255)
: _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255);
if (r1 === 64) {
binArray.push(_fromCC(u24 >> 16 & 255));
}
else if (r2 === 64) {
binArray.push(_fromCC(u24 >> 16 & 255, u24 >> 8 & 255));
}
else {
binArray.push(_fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255));
}
}
return bin;
return binArray.join('');
};

@@ -215,0 +222,0 @@ /**

@@ -12,3 +12,3 @@ /**

*/
const version = '3.7.7';
const version = '3.7.8';
/**

@@ -167,3 +167,4 @@ * @deprecated use lowercase `version`.

asc += '=='.slice(2 - (asc.length & 3));
let u24, bin = '', r1, r2;
let u24, r1, r2;
let binArray = []; // use array to avoid minor gc in loop
for (let i = 0; i < asc.length;) {

@@ -174,7 +175,13 @@ u24 = b64tab[asc.charAt(i++)] << 18

| (r2 = b64tab[asc.charAt(i++)]);
bin += r1 === 64 ? _fromCC(u24 >> 16 & 255)
: r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255)
: _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255);
if (r1 === 64) {
binArray.push(_fromCC(u24 >> 16 & 255));
}
else if (r2 === 64) {
binArray.push(_fromCC(u24 >> 16 & 255, u24 >> 8 & 255));
}
else {
binArray.push(_fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255));
}
}
return bin;
return binArray.join('');
};

@@ -181,0 +188,0 @@ /**

{
"name": "js-base64",
"version": "3.7.7",
"version": "3.7.8",
"description": "Yet another Base64 transcoder in pure-JS",

@@ -5,0 +5,0 @@ "main": "base64.js",

@@ -28,3 +28,3 @@ [![CI via GitHub Actions](https://github.com/dankogai/js-base64/actions/workflows/node.js.yml/badge.svg)](https://github.com/dankogai/js-base64/actions/workflows/node.js.yml)

```html
<script src="https://cdn.jsdelivr.net/npm/js-base64@3.7.7/base64.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/js-base64@3.7.8/base64.min.js"></script>
```

@@ -52,3 +52,3 @@

// note jsdelivr.net does not automatically minify .mjs
import { Base64 } from 'https://cdn.jsdelivr.net/npm/js-base64@3.7.7/base64.mjs';
import { Base64 } from 'https://cdn.jsdelivr.net/npm/js-base64@3.7.8/base64.mjs';
</script>

@@ -60,3 +60,3 @@ ```

// or if you prefer no Base64 namespace
import { encode, decode } from 'https://cdn.jsdelivr.net/npm/js-base64@3.7.7/base64.mjs';
import { encode, decode } from 'https://cdn.jsdelivr.net/npm/js-base64@3.7.8/base64.mjs';
</script>

@@ -63,0 +63,0 @@ ```