Socket
Socket
Sign inDemoInstall

string-to-arraybuffer

Package Overview
Dependencies
2
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    string-to-arraybuffer

Convert base64/datauri/plain string to ArrayBuffer


Version published
Maintainers
2
Install size
23.9 kB
Created

Readme

Source

string-to-arraybuffer unstable Build Status

Turn dataURI/base64/plain string into an ArrayBuffer.

npm install string-to-arraybuffer

var str2ab = require('string-to-arraybuffer')

// Plain 'Hello World!'
var abuf1 = str2ab('Hello World!')

// Base-64 'Hello World!'
var abuf2 = str2ab('SGVsbG8sIFdvcmxkIQ%3D%3D')

// Barebones data-uri 'Hello World!'
var abuf3 = str2ab('data:,Hello%2C%20World!')

// Base-64 data-uri 'Hello World!'
var abuf4 = str2ab('data:text/plain;base64,SGVsbG8sIFdvcmxkIQ%3D%3D')

Keywords

FAQs

Last updated on 09 Nov 2018

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