What are JavaScript's builtin strings?

前端 未结 7 584
情歌与酒
情歌与酒 2020-11-28 00:52

this question is difficult to summarize in a question title

UPDATE I created a JSFiddle that builds an obfuscated string out of your input

7条回答
  •  长情又很酷
    2020-11-28 01:12

    This is about as close as I could get, unfortunately it violates the convention of the original obfuscation by making a call to unescape():

    unescape((/%/+[])[1]+(/1/[1]+[])[1%1]+(+!1)+(+!1)+(1e1+(11*(1-~1)<<1)))
    

    Teardown:

    (/%/+[])[1]          => "%"
    (/1/[1]+[])[1%1]     => "u"
    (+!1)                => "0"
    (+!1)                => "0"
    (1e1+(11*(1-~1)<<1)) => "76"
    ===========================
    unescape("%u0076")   => "v"
    

    Other ideas:

    1. Somehow get to unescape("\x76")
    2. Somehow convert 118 without calling String.fromCharCode()
    3. Get the text from an exception with the word "Invalid" in it

    Updates:

    I started playing code golf and have been making it shorter, replacing parts with more 1s, etc.

提交回复
热议问题