Advertisement
leomaster

ghost 64 constructor, replace, fromCodePoint

Nov 20th, 2021 (edited)
729
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Transforms any text to a zero width string thus making it invisible
  2. // Call with 2nd param true to decode invisible text into original
  3. // ------------------------------
  4. // masterleo@gmail.com 18/11/2021
  5.  
  6. const ghost = ($,ǃ) => (($,ǃ,g,h,o,s,t)=>(
  7.     [g][g][g]('λ={'+`${[][g](124)}`
  8.     [o](/./g,(λ,x)=>λ[g][h](x))
  9.     [o](/[^a-z\d+/=]/gi,'')
  10.     [o](/./g,(λ,x)=>`"${λ}":"${s=λ[g][h](8288+x/16|0,8288+x%16)}","${s}":"${λ}",`)
  11.     [o](/,$/,'};'))(), t=λ,
  12.         ǃ.at() == 'e' ?
  13.         btoa(window[ǃ]($))[o](/./g,λ=>t[λ]) :
  14.         window[ǃ](atob($[o](/../g,λ=>t[λ])))
  15.     ))
  16.     ($,(ǃ?'de':'en')+'codeURI','constructor','fromCodePoint','replace');
  17.  
  18. //make sample code invisible
  19. let hidden = ghost("open`https://youtu.be/dQw4w9WgXcQ`");
  20. console.log(hidden);
  21.  
  22. //reveal hidden code
  23. let shown = ghost(hidden, true);
  24. console.log(shown, true);
  25.  
  26. // execute
  27. \u0065val(shown);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement