b32
Implementation of RFC-3548 Base32 encoding/decoding for node using C (suppose to be faster than pure javascript).
Features
- Implemented in C
- Sync & Async methods support
- Options to add '=' paddings
- Promises chaining support (Thanks to q)
Installation
npm install b32
Test
npm test
Usage
var b32 = ;// Encode a string and use callback to pick up the result b32; // Encode a buffer and use promisesb32 ; // Decode a string in synchronize modevar decoded = b32; // Decode a buffer with async functionb32 ;
Functions
encodeSync(Buffer[,options])
options:
- padding: Boolean (default: false) add '=' padding to the end Returns: Encoded base32 string in buffer
decodeSync(Buffer)
Returns: Decoded binary buffer
encode(Buffer,[options],[callback])
options:
- same as sync function callback: a function with signature function(err,result) Returns: A promise which will resolve with the result
decode(Buffer,[callback])
callback: a function with signature function(err,result) Returns: A promise which will resolve with the result