Coder Social home page Coder Social logo

rcnb.js's Introduction

RCNB.js Node.js CI

The world is based on RC. Thus, everything can be encoded into RCNB.

RCNB is available in various languages: JavaScript C PHP Pascal (more..)

Why RCNB?

RCNB vs Base64

Base64 RCNB
Speed ❌ Fast ✔️ Slow, motivate Intel to improve their CPU
Printable ❌ On all OS ✔️ Only on newer OS, motivate users to upgrade their legacy OS
Niubility ❌ Not at all ✔️ RCNB!
Example QmFzZTY0Lg== ȐĉņþƦȻƝƃŔć

Install

$ npm install --save rcnb # Add RCNB.js to your package
$ npm install -g rcnb # Install RCNB.js as a global CLI

Import

In Browser

<script src="rcnb.js"></script>

Node.js

const rcnb = require('rcnb')

Usage

In Code

rcnb.encode(new Uint8Array([114, 99, 110, 98])) // 'ɌcńƁȓČņÞ'
rcnb.decode('ɌcńƁȓČņÞ') // Uint8Array [114, 99, 110, 98]

rcnb.encode(new TextEncoder('utf-8').encode('Who NB?')) // 'ȐȼŃƅȓčƞÞƦȻƝƃŖć'
new TextDecoder('utf-8').decode(rcnb.decode('ȐĉņþƦȻƝƃŔć')) // 'RCNB!'

With NodeJS Stream API

const rcnb = require('rcnb')
const fs = require('fs')

fs.createReadStream('input.txt')
  .pipe(rcnb.encodeStream())
  .pipe(fs.createWriteStream('rcnb.txt'))

fs.createReadStream('rcnb.txt')
  .pipe(rcnb.decodeStream())
  .pipe(fs.createWriteStream('output.txt'))

encodeStream([options]) / decodeStream([options])

Support all available options of stream.Transform

Note that only streams of Buffer or string are supported.

CLI

$ rcnb encode "Who NB?"
#   ȐȼŃƅȓčƞÞƦȻƝƃŖć

$ rcnb decode "ȐĉņþƦȻƝƃŔć"
#   RCNB!

$ echo "The world is based on RC thus RCNB" >rcnb.txt
$ rcnb encode -- <rcnb.txt # With the option `--`, RCNB.js CLI reads from stdin.
#   ȐčnÞȒċƝÞɌČǹƄɌcŅƀȒĉȠƀȒȼȵƄŕƇŅbȒCŅßȒČnƅŕƇņƁȓċȵƀȐĉņþŕƇņÞȒȻŅBɌCňƀȐĉņþƦȻƝƃrƇ

rcnb.js's People

Contributors

coxxs avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.