string-to-arraybuffer
Convert base64/datauri/plain string to ArrayBuffer
Last updated 9 months ago by dfcreative .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install string-to-arraybuffer 
SYNC missed versions from official npm registry.

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')

Related

Current Tags

  • 1.0.2                                ...           latest (9 months ago)

3 Versions

  • 1.0.2                                ...           9 months ago
  • 1.0.1                                ...           10 months ago
  • 1.0.0                                ...           2 years ago
Maintainers (2)
Downloads
Today 9
This Week 152
This Month 590
Last Day 41
Last Week 183
Last Month 852
Dependencies (2)
Dev Dependencies (3)

Copyright 2014 - 2016 © taobao.org |