Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Transforms any text to a zero width string
- // technically there's room for 80 mappings
- // but we settle to use btoa first thus 65 chars are mapped
- // there is a div/mod loop way to generate the inv
- // for b64 alphabet plain text is almost best choice
- // call with param invisible results into original text
- // ----------
- // masterleo@gmail.com 18/11/2021
- const ghost = λ => (Λ=Object.fromEntries([...'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='].reduce((m,a,p)=>[...m, [a, $=String.fromCodePoint(8234+p/16|0, 8288+p%16)], [$, a]],[])), λ.charAt() in Λ ? btoa(λ).replace(/./g, $=>Λ[$] || '') : atob(λ.replace(/../g, $=>Λ[$] || '')));
- //call res = ghost(code) with normal code text to return the invisible result
- let hide = ghost( "open`https://youtu.be/dQw4w9WgXcQ`" );
- console.log(hide); // invisible
- //call ghost with param being invisible character collection to return original text
- let show = ghost(hide);
- console.log(show);
- \u0065val(show);
- /////////////////
- const ghost = λ => ((λ,c,r,f,s,M)=>(M=JSON.parse('{'+`${[][c](124)}`[r](/./g,($,i)=>c[c][f](i))[r](/[^A-Z0-9+/=]/gi,'')[r](/./g,($,i)=>`"${$}":"${s=c[c][f](8234+i/16|0,8288+i%16)}","${s}":"${$}",`)[r](/,$/,'}')),λ.at() in M?btoa(λ)[r](/./g,$=>M[$]):atob(λ[r](/../g,$=>M[$]))))(λ,'constructor','replace','fromCodePoint');
- let hide = ghost( "open`https://youtu.be/dQw4w9WgXcQ`" );
- console.log(hide);
- let show = ghost(hide);
- console.log(show);
- // execute
- \u0065val(show);
Add Comment
Please, Sign In to add comment