ascii2binary
v1.0.0
Published
ascii2binary
Downloads
2
Maintainers
Readme
English | 简体中文
ascii2binary
Base64-string to ArrayBuffer
Install
// npm
$ npm install --save ascii2binary
// yarn
$ yarn add ascii2binary
// pnpm
$ pnpm add ascii2binary
Usage
ES6 Module
// Note that there is no default export
import { ascii2binary } from 'ascii2binary';
node.js (commonjs)
// Note that there is no default export
const { ascii2binary } = require('ascii2binary')
Use
// Input base64 string
ascii2binary('yq==') // ArrayBuffer: [202]
Convert Picture
// Base64 string to ArrayBuffer
const base64 = 'iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAV0lEQVQImWP8DwQMWAATjPFkZztDuLUBg5pJBEP1+vsMjGAdj1YyhHu0M5yHq5eG6njzFEkQBJ5CJUSkGQxRJKQZGP5DweMdbf/DrPT/qxqH/69ad+8/AGWjJsYqydAgAAAAAElFTkSuQmCC'
ascii2binary(base64) // ArrayBuffer: [...]
Development and construction
Installation Dependencies
$ pnpm install
Repackage
$ pnpm run build
Test
It is necessary to install the development software
$ pnpm run test