You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

b64ab

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

b64ab

Convert between Base-64 Strings and ArrayBuffer Objects. Simple. Isomorphic. Light-weight.

0.0.1
latest
Source
npmnpm
Version published
Weekly downloads
336
-30.72%
Maintainers
1
Weekly downloads
 
Created
Source

b64ab

install

npm install b64ab

usage

import { toBase64String, toArrayBuffer } from "b64ab";

// create an Array Buffer
const ab = Uint8Array.from([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]).buffer;

// convert an Array Buffer to a Base-64 String
toBase64String(ab);
"AQIDBAUGBwgJCg=="

// convert a Base-64 String to an Array Buffer
toArrayBuffer("AQIDBAUGBwgJCg==")
ArrayBuffer {
  [Uint8Contents]: <01 02 03 04 05 06 07 08 09 0a>,
  byteLength: 10
}

Keywords

arraybuffer

FAQs

Package last updated on 13 May 2023

Did you know?

Socket

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