aemkei / jsfuck

Write any JavaScript with 6 Characters: []()!+
jsfuck.com
Do What The F*ck You Want To Public License
8.12k stars 672 forks source link

Encode all capital letters and some ASCII symbols below 3400 chars #61

Open pallosp opened 7 years ago

pallosp commented 7 years ago

The idea is

'M' == []["fill"]["constructor"]("return btoa(0)")()[0]
'Q' == []["fill"]["constructor"]("return btoa(1)")()[1]
'Z' == []["fill"]["constructor"]("return btoa(false)")()[0]
'|' == []["fill"]["constructor"]("return atob(1018)")()[2]
'~' == []["fill"]["constructor"]("return atob(134)")()[1]
hazzik commented 7 years ago

Thanks! But btoa/atob are not available on NodeJS. So I don't think it can be accepted.

hazzik commented 7 years ago

Also, it is better to encode like this:

'M' == []["fill"]["constructor"]("return btoa")()(0)[0]

btoa/atob call outside of the function constructor

hazzik commented 7 years ago

I have this implemented: https://github.com/hazzik/jsfuck/blob/atob-btoa/output.txt so, it's under 2500 characters actually (and most of characters are below 1800)