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/base32for yarn:
yarn add @voken/base32API
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)
// => 58t39ecg6jvs0c4g6ax31dnr6rs9edecode(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:
Credits
- Mike Hearn for original Java implementation
- Stefan Thomas for porting to JavaScript
- Stephan Pair for buffer improvements
- Daniel Cousens for cleanup and merging improvements from bitcoinjs-lib
- Jared Deckard for killing
bigias a dependency
License
MIT