Skip to content

svaraborut/b32

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TL;DR;

Basic usage

const { encode, decode, updateDefaultOptions } = require('b32');

// Setup b32 to return strings rather than buffers
updateDefaultOptions({ encode: 'string'});

encode('foobar')
// MZXW6YTBOI======

decode('MZXW6YTBOI======')
// foobar

Usage with buffers and padding validation

const { encode, decode } = require('b32');

encode('foobar').toString()
// MZXW6YTBOI======

encode('foobar', { addPadding: false }).toString()
// MZXW6YTBOI

encode('foobar', { addPadding: false, encode: 'string' })
// MZXW6YTBOI

decode('MZXW6YTBOI======').toString('utf8')
// foobar

decode('MZXW6YTBOI', { checkPadding: false }).toString('utf8')
// foobar

About

Fast Base32 library for Node.js - RFC4648

Resources

Stars

Watchers

Forks

Packages

No packages published