Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mscdex/base91.js
basE91 encoding/decoding for node.js and browsers
https://github.com/mscdex/base91.js
Last synced: 2 months ago
JSON representation
basE91 encoding/decoding for node.js and browsers
- Host: GitHub
- URL: https://github.com/mscdex/base91.js
- Owner: mscdex
- License: other
- Created: 2013-06-30T23:00:40.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-12-06T08:43:03.000Z (about 9 years ago)
- Last Synced: 2024-10-14T12:07:32.736Z (3 months ago)
- Language: JavaScript
- Size: 1.49 MB
- Stars: 31
- Watchers: 4
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Description
===========base91.js is a base91 implementation in javascript that allows encoding/decoding of data to/from an ASCII representation that is more compact than base64.
More information about the base91 algorithm itself can be found [here](http://base91.sourceforge.net/).
Requirements
============* [node.js](http://nodejs.org/) -- v0.8.0 or newer, or any browser
Installation
============npm install base91
Example
=======```javascript
var base91 = require('base91');console.log(base91.encode('node.js rules!'));
console.log(base91.decode(base91.encode('node.js rules!')).toString());// outputs:
// lref5gTT$FQ;C90ohA
// node.js rules!
```API
===Functions
---------* **encode**(< _mixed_ >data) - _string_ - Encodes `data` and returns the resulting base91 representation. `data` can be a string or an Array-like object (e.g. Buffer in node.js, Uint8Array or Array in browsers).
* **decode**(< _string_ >encodedData) - _mixed_ - Decodes `encodedData` and returns the result. For node.js, it will return a Buffer, otherwise it will return a Uint8Array if available, or a plain Array as a final fallback.