rot13-stream

rot13 encoding/decoding stream

rot13-stream

This repository is an example of how you can create a readable and writable stream, a through stream, in node. This particular stream transforms input by applying the ROT13 substitution cipher and is based on through by @dominictarr.

example.js

var rot13 = require('rot13-stream')();
process.stdin.pipe(rot13).pipe(process.stdout)
$ echo 'The quick brown fox jumps over the lazy dog' | node example.js
Gur dhvpx oebja sbk whzcf bire gur ynml qbt

This cipher is also an example of an encrypting algorithm which is its own inverse, i.e. applying it twice produces the same output as the input:

$ echo 'Gur dhvpx oebja sbk whzcf bire gur ynml qbt' | node example.js
The quick brown fox jumps over the lazy dog
npm install rot13-stream

MIT