2.0.1 • Published 2 years ago

rcnb v2.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
2 years ago

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

Base64RCNB
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!
ExampleQmFzZTY0Lg==ȐĉņþƦȻƝƃŔć

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Ƈ
1.1.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.1.1

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago