Skip to content

Instantly share code, notes, and snippets.

@wraithgar
Created April 18, 2019 17:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wraithgar/ffe8efadd0ca7caac212aa014edff16d to your computer and use it in GitHub Desktop.
Save wraithgar/ffe8efadd0ca7caac212aa014edff16d to your computer and use it in GitHub Desktop.
const clean = 'bullshit';
let dirty = '';
for (const letter of clean) {
const hex = letter.charCodeAt().toString(16);
dirty = dirty + unescape(`%uDB40%uDD${hex}`);
}
console.log(`Clean: ${clean}`);
console.log(`Dirty: ${dirty}`);
console.log(`Stripped: ${unescape(escape(dirty).replace(/u.{8}/g,''))}`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment