Encodes/decodes binary data as a sequence of emojis.
Encodes every byte as an emoji in utf8, so 32 bits! 25% efficient.
Requires node >= 10.
Binary file
node base-lol.mjs < targets/max.jpg > max.base-lol
node base-lol.mjs --decode < max.base-lol > max-decoded.jpg
diff targets/max.jpg max-decoded.jpg
Something readable:
ฦ cat targets/smiley.svg
<svg xmlns="http://www.w3.org/2000/svg"><circle fill="#FF0" cx="6" cy="6" r="6"/><circle cx="3" cy="4" r="1"/><circle cx="7" cy="4" r="1"/><path d="M2,6 C2,6 3,12 8,6"/></svg>
ฦ node dist/base-lol.js < targets/smiley.svg
๐ผ๐ฒ๐ต๐ฆ๐ ๐ท๐ฌ๐ซ๐ญ๐ฒ๐ฝ๐ข๐ง๐ณ๐ณ๐ฏ๐บ๐ฏ๐ฏ๐ถ๐ถ๐ถ๐ฎ๐ถ๐ณ๐ฎ๐ฎ๐ฑ๐ฆ๐ฏ๐ฒ๐ฐ๐ฐ๐ฐ๐ฏ๐ฒ๐ต๐ฆ๐ข๐พ๐ผ๐ข๐จ๐ฑ๐ข๐ซ๐ค๐ ๐ฅ๐จ๐ซ๐ซ๐ฝ๐ข๐ฃ๐
๐
๐ฐ๐ข๐ ๐ข๐ท๐ฝ๐ข๐ถ๐ข๐ ๐ข๐ธ๐ฝ๐ข๐ถ๐ข๐ ๐ฑ๐ฝ๐ข๐ถ๐ข๐ฏ๐พ๐ผ๐ข๐จ๐ฑ๐ข๐ซ๐ค๐ ๐ข๐ท๐ฝ๐ข๐ณ๐ข๐ ๐ข๐ธ๐ฝ๐ข๐ด๐ข๐ ๐ฑ๐ฝ๐ข๐ฑ๐ข๐ฏ๐พ๐ผ๐ข๐จ๐ฑ๐ข๐ซ๐ค๐ ๐ข๐ท๐ฝ๐ข๐ท๐ข๐ ๐ข๐ธ๐ฝ๐ข๐ด๐ข๐ ๐ฑ๐ฝ๐ข๐ฑ๐ข๐ฏ๐พ๐ผ๐ฏ๐ ๐ณ๐ง๐ ๐ฃ๐ฝ๐ข๐๐ฒ๐ฌ๐ถ๐ ๐๐ฒ๐ฌ๐ถ๐ ๐ณ๐ฌ๐ฑ๐ฒ๐ ๐ธ๐ฌ๐ถ๐ข๐ฏ๐พ๐ผ๐ฏ๐ฒ๐ต๐ฆ๐พ
ฦ node dist/base-lol.js < targets/smiley.svg | node dist/base-lol.js --decode
<svg xmlns="http://www.w3.org/2000/svg"><circle fill="#FF0" cx="6" cy="6" r="6"/><circle cx="3" cy="4" r="1"/><circle cx="7" cy="4" r="1"/><path d="M2,6 C2,6 3,12 8,6"/></svg>