garble
A fun JavaScript text-garbler using Unicode combining characters (diacritics).
Try it Out!
You can try it out in the browser here.
Usage
This library exports a function (named garble
for browser users) that garbles
text in a random fashion using Unicode combining characters (diacritics). For
example:
var garble = require("garble");
console.log(garble("hello, world"));
// h͚̠̙̒e̖͇ͬ̕ļ̹̯ͩl̘ͮ͢͞o̷̪͓ͅ,͚̑̊͢ ̤̫̿͌w̥̦̹͢ö̥͊͜r̜̓̅͘l̓̉̀͝d̫́̉
It takes additional parameters to control the minimum and maximum number of diacritics added to each character (defaults to 20-30):
var garble = require("garble");
console.log(garble("hello, world", 0, 1));
// ḧe̟l͕l̝o, w̅orl̢d̅
Command-Line Usage
Included in the npm package is a CLI executable that garbles the input. For example:
garble
hello world
h̤̊͟͏e̵̖̠̚l̫ͬ͠ͅl͚̓̀ͤo̜̻̔͆ ͓͗͒̕w̧ͩ̂̒ơ̵̙̊r̬ͫ̾̔l̺͔͓ͦd̷̘͈̾
Docker Usage
This is also available using docker. You can build it from source by running
docker build -t garble .
docker run -it garble
hello world
h̤̊͟͏e̵̖̠̚l̫ͬ͠ͅl͚̓̀ͤo̜̻̔͆ ͓͗͒̕w̧ͩ̂̒ơ̵̙̊r̬ͫ̾̔l̺͔͓ͦd̷̘͈̾
Or to use the image deployed to Docker Hub as a trusted build:
docker run -it nubs/garble
hello world
h̤̊͟͏e̵̖̠̚l̫ͬ͠ͅl͚̓̀ͤo̜̻̔͆ ͓͗͒̕w̧ͩ̂̒ơ̵̙̊r̬ͫ̾̔l̺͔͓ͦd̷̘͈̾
License
garble is licensed under the MIT license. See LICENSE for the full license text.