@vandeurenglenn/base-x
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

base-x

module compatible base-x

install

npm i -S @vandeurenglenn/base-x

usage

const base = require('@vandeurenglenn/base-x')
// or
import base from '@vandeurenglenn/base-x'

const base32 = base('abcdefghijklmnopqrstuvwxyz234567') // base32 Alphabet

// encode
const uint8Array = new TextEncoder().encode('hi');
const bs32 = base32.encode(uint8Array)
console.log(bs32); // '2dj'

// decode
const hi = base32.decode(bs32)
const string = new TextDecoder().decode(hi);
console.log(string) // 'hi'

Readme

Keywords

Package Sidebar

Install

npm i @vandeurenglenn/base-x

Weekly Downloads

6

Version

1.1.3

License

MIT

Unpacked Size

11.9 kB

Total Files

8

Last publish

Collaborators

  • vandeurenglenn