1.0.0 • Published 1 year ago

ascii2binary v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

npm GitHub stars GitHub issues GitHub license CI via GitHub Actions

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