rcnb
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

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 type="module">
  import rcnb from 'https://cdn.jsdelivr.net/npm/rcnb@2/rcnb.min.js'
</script>

Node.js

import rcnb from '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

import fs from 'fs'
import { EncodeStream, DecodeStream } from 'rcnb'

fs.createReadStream('input.txt')
  .pipe(new EncodeStream())
  .pipe(fs.createWriteStream('rcnb.txt'))

fs.createReadStream('rcnb.txt')
  .pipe(new 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Ƈ

Readme

Keywords

Package Sidebar

Install

npm i rcnb

Weekly Downloads

0

Version

2.0.1

License

MIT

Unpacked Size

18.7 kB

Total Files

11

Last publish

Collaborators

  • coxxs