Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

base64-arraybuffer-es6

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

base64-arraybuffer-es6 - npm Package Compare versions

Comparing version 0.4.1 to 0.4.2

5

CHANGES.md
# base64-arraybuffer-es6
## 0.4.2
- Fix: Overcome Safari's idiosyncrasies with `Uint8Array` constructor
(@dfahlander).
## 0.4.1

@@ -4,0 +9,0 @@

9

dist/base64-arraybuffer-es.js

@@ -17,4 +17,9 @@ /*

var encode = function encode(arraybuffer, byteOffset, length) {
var bytes = new Uint8Array(arraybuffer, byteOffset, length),
len = bytes.length;
if (length === null || length === undefined) {
length = arraybuffer.byteLength; // Needed for Safari
}
var bytes = new Uint8Array(arraybuffer, byteOffset || 0, // Default needed for Safari
length);
var len = bytes.length;
var base64 = '';

@@ -21,0 +26,0 @@

@@ -23,4 +23,9 @@ (function (global, factory) {

var encode = function encode(arraybuffer, byteOffset, length) {
var bytes = new Uint8Array(arraybuffer, byteOffset, length),
len = bytes.length;
if (length === null || length === undefined) {
length = arraybuffer.byteLength; // Needed for Safari
}
var bytes = new Uint8Array(arraybuffer, byteOffset || 0, // Default needed for Safari
length);
var len = bytes.length;
var base64 = '';

@@ -27,0 +32,0 @@

{
"name": "base64-arraybuffer-es6",
"description": "Encode/decode base64 data into ArrayBuffers",
"version": "0.4.1",
"version": "0.4.2",
"homepage": "https://github.com/brettz9/base64-arraybuffer",

@@ -6,0 +6,0 @@ "author": "Brett Zamir",

@@ -18,6 +18,13 @@ /*

export const encode = function (arraybuffer, byteOffset, length) {
const bytes = new Uint8Array(arraybuffer, byteOffset, length),
len = bytes.length;
if (length === null || length === undefined) {
length = arraybuffer.byteLength; // Needed for Safari
}
const bytes = new Uint8Array(
arraybuffer,
byteOffset || 0, // Default needed for Safari
length
);
const len = bytes.length;
let base64 = '';
for (let i = 0; i < len; i += 3) {

@@ -24,0 +31,0 @@ base64 += chars[bytes[i] >> 2];

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc