Socket
Socket
Sign inDemoInstall

base64-arraybuffer

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

base64-arraybuffer

Encode/decode base64 data into ArrayBuffers


Version published
Maintainers
1
Weekly downloads
4,022,855
decreased by-8.59%

Weekly downloads

Package description

What is base64-arraybuffer?

The base64-arraybuffer npm package provides functionality to encode and decode base64 strings to and from ArrayBuffers, which are a generic, fixed-length raw binary data buffer in JavaScript. It is useful when dealing with binary data in web applications, such as files handling and network communication.

What are base64-arraybuffer's main functionalities?

Encode ArrayBuffer to base64

This feature allows you to convert an ArrayBuffer into a base64 encoded string. The code sample demonstrates how to create an ArrayBuffer and encode it to a base64 string using the Encoder class.

const base64 = require('base64-arraybuffer');
const encoder = new base64.Encoder();
const arrayBuffer = new ArrayBuffer(8);
const base64String = encoder.encode(arrayBuffer);

Decode base64 to ArrayBuffer

This feature enables you to convert a base64 encoded string back into an ArrayBuffer. The code sample shows how to decode a base64 string to an ArrayBuffer using the Decoder class.

const base64 = require('base64-arraybuffer');
const decoder = new base64.Decoder();
const base64String = 'someBase64String';
const arrayBuffer = decoder.decode(base64String);

Other packages similar to base64-arraybuffer

Readme

Source

base64-arraybuffer

CI NPM Downloads NPM Version

Encode/decode base64 data into ArrayBuffers

Installing

You can install the module via npm:

npm install base64-arraybuffer

API

The library encodes and decodes base64 to and from ArrayBuffers

  • encode(buffer) - Encodes ArrayBuffer into base64 string
  • decode(str) - Decodes base64 string to ArrayBuffer

Testing

You can run the test suite with:

npm test

License

Copyright (c) 2012 Niklas von Hertzen Licensed under the MIT license.

FAQs

Last updated on 22 Jan 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc