Skip to content

Instantly share code, notes, and snippets.

@plugnburn

plugnburn/LICENSE.txt

Forked from 140bytes/LICENSE.txt
Last active Dec 20, 2015
Embed
What would you like to do?
Whitespace text encoder

Whitespace Encoder

Encode any arbitrary text into a set of spaces, tabs and form-feeds. Just 132 bytes.

Usage

wsenc("I'm a hidden text!")

For a decoder, see this snippet.

function(t){return t.split("").map(function(n){return n.charCodeAt(0).toString(2).replace(/1/g,"\t").replace(/0/g," ")}).join("\f")}
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2013 plugnburn
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
{
"name": "wsenc",
"description": "Encode any arbitrary text into a set of spaces, tabs and form-feeds",
"keywords": [
"whitespace",
"text",
"encoder",
"steganography"
]
}
@atk

This comment has been minimized.

Copy link

@atk atk commented Aug 6, 2013

How about:

function W(h,s){return 1+s?(s?'':'\f')+h.charCodeAt(0).toString(2).replace(/1/g,'\t').replace(/0/,' '):h.replace(/[^]/g,W)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment