Skip to content

Latest commit

 

History

History
29 lines (20 loc) · 1.27 KB

README.md

File metadata and controls

29 lines (20 loc) · 1.27 KB

Installation

To install node-obf, use npm:

$ npm install node-obf

Usage

require('node-obf').obfuscate(global variable, code);

Example:

var obf = require('node-obf');
obf.obfuscate('$$', 'alert("hello world!")');

This will return

$$=~[];$$={___:++$$,$$$$:(![]+"")[$$],__$:++$$,$_$_:(![]+"")[$$],_$_:++$$,$_$$:({}+"")[$$],$$_$:($$[$$]+"")[$$],_$$:++$$,$$$_:(!""+"")[$$],$__:++$$,$_$:++$$,$$__:({}+"")[$$],$$_:++$$,$$$:++$$,$___:++$$,$__$:++$$};$$.$_=($$.$_=$$+"")[$$.$_$]+($$._$=$$.$_[$$.__$])+($$.$$=($$.$+"")[$$.__$])+((!$$)+"")[$$._$$]+($$.__=$$.$_[$$.$$_])+($$.$=(!""+"")[$$.__$])+($$._=(!""+"")[$$._$_])+$$.$_[$$.$_$]+$$.__+$$._$+$$.$;$$.$$=$$.$+(!""+"")[$$._$$]+$$.__+$$._+$$.$+$$.$$;$$.$=($$.___)[$$.$_][$$.$_];$$.$($$.$($$.$$+"\""+$$.$_$_+(![]+"")[$$._$_]+$$.$$$_+"\\"+$$.__$+$$.$$_+$$._$_+$$.__+"(\\\"\\"+$$.__$+$$.$_$+$$.___+$$.$$$_+(![]+"")[$$._$_]+(![]+"")[$$._$_]+$$._$+"\\"+$$.$__+$$.___+"\\"+$$.__$+$$.$$_+$$.$$$+$$._$+"\\"+$$.__$+$$.$$_+$$._$_+(![]+"")[$$._$_]+$$.$$_$+"!\\\")"+"\"")())();

OG

All credit to Yosuke Hasegawa. All I did was find this on SO, clean up the source, and turn it into a node module. You can view the original authors site at http://utf-8.jp/