Text to javascript encoder. Just run the js to get the text back.
No, it doesn't have any real purpose nor foreseen application. I guess you could maybe use it to send a fancy messages to a fellow hacker ?
For more useless js experiments, see https://github.com/centime/reverJS and https://github.com/centime/jsfsck
> jsEncode('javascript is fun')
'(-((_=($=+!![])-~$)-++_)*(+[$]+[_-~_]+[_-~$]+[$-$]+[\
_-$]+[$-$]+[_-$]+[$-$]+[_]+[-~_-~$]+[$]+[-~_-~$]+[-~_\
-~$]+[$-$]+[_+_]+[_-~_]))[_$=((_$=(!![]+[]))[$_=+[]]+\
[[]+{}][$_][$]+[+[]+($$=([]+[])[(![]+{})[[$]+$_]+({}+\
_$)[$]+([]+_$[_$])[$]+(!_$+_$)[$-~$]+_$[$_]+_$[$]+_$[\
-~$]+(![]+{})[[$]+$_]+_$[$_]+({}+_$)[$]+_$[$]])][$_][\
$+[$_]]+_$[$_]+_$[$]+([![]]+[][[]])[$+[$_]]+([][[]]+[\
])[$]+(![]+[$_]+$$)[$+$+[$_]])]($_=$-~$+[(_)-~$])+($$\
=[!![]+{}][$-$][$+[$]])+($*(+[_-~$]+[-~_-~$]+[_-~$]))\
[_$]($_)+$$+($*(+[-~$]+[$-$]+[-~_]+[_]+[_-$]))[_$]($_)'
> eval(jsEncode('javascript is fun'))
'javascript is fun'
Currently supported:
lowercases
numbers
spaces
words of 10 chars max.
Could potentially be supported:
long words
more punctuation
it's really just this simple function:
jsEncode= /*--- https://github.com/centime/jsEncode ---*/
(s)=>(r='',s.replace(/[^a-zA-Z0-9 ]/g,' ').trim().split('\
').forEach((w,i)=>(r+=(i==0?'':i>1?'+$$':'+($$=[!![]+{}]\
[$-$][$+[$]])')+(w?(n=(i>0?'+($':'(-((_=($=+!![])-~$)-++_\
)')+'*(',String(parseInt(w,36)).split('').forEach((l)=>n+=
'+['+['$-$','$','-~$','_-$','_','-~_','_-~$','-~_-~$','_+\
_','_-~_'][l]+']'),n+'))[_$'+(i>0?']($_)':'=((_$=(!![]+[]\
))[$_=+[]]+[[]+{}][$_][$]+[+[]+($$=([]+[])[(![]+{})[[$]+$\
_]+({}+_$)[$]+([]+_$[_$])[$]+(!_$+_$)[$-~$]+_$[$_]+_$[$]+\
_$[-~$]+(![]+{})[[$]+$_]+_$[$_]+({}+_$)[$]+_$[$]])][$_][$\
+[$_]]+_$[$_]+_$[$]+([![]]+[][[]])[$+[$_]]+([][[]]+[])[$]\
+(![]+[$_]+$$)[$+$+[$_]])]($_=$-~$+[(_)-~$])')):''))),r)