web-base64

1.0.2 • Public • Published

Web Base64

Slightly modernized version of base64-js.

Main difference is the option to generate URL-friendly Base64, where

  • + => -,
  • / => _ and
  • = => ~ (these are unreserved URI characters according to RFC 3986)

This version also drops support for platforms that don't provide Uint8Array and DataView.

API has slightly changed and now expects an ArrayBuffer instead of an Uint8Array, whcih makes it easier to use with other typed arrays and without the need for additional copying.

Usage

const mobyDick = await fs.promises.readFile(path.resolve('test/mobydick.txt'));
const b64String = fromByteArray(mobyDick.buffer)

Readme

Keywords

none

Package Sidebar

Install

npm i web-base64

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

14.4 kB

Total Files

6

Last publish

Collaborators

  • qwtel