JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 37
  • Score
    100M100P100Q59177F
  • License MIT

VOKEN Flavored Base32 Encoding and Decoding

Package Exports

  • @voken/base32

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@voken/base32) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@voken/base32

JavaScript component to compute voken flavored base 32 encoding. This encoding is typically used for VOKEN (crypto-currency).

Install

npm i --save @voken/base32

for yarn:

yarn add @voken/base32

API

encode(input)

input must be a Buffer or an Array. It returns a string.

example:

const base32 = require('@voken/base32')

const bytes = Buffer.from('This is a example.')
const decoded = base32.encode(bytes)
console.log(decoded)
// => 58t39ecg6jvs0c4g6ax31dnr6rs9e

decode(input)

input must be a base 58 encoded string. Returns a Buffer.

example:

const base32 = require('@voken/base32')

const encoded = '58t39ecg6jvs0c4g6ax31dnr6rs9e'
const bytes = base32.decode(encoded)
console.log(bytes.toString())
// => This is a example.

Hack / Test

Uses JavaScript standard style. Read more:

js-standard-style

Credits

License

MIT