obfuscate javascript code with php [duplicate]

0

I have a question regarding a javascript code renderer made in php .. link

Can anyone help me understand how this guy did to generate?

    
asked by anonymous 13.10.2018 / 02:16

1 answer

0

Today most projects with serious development in javascript end up doing this with nodejs and webpack as part of the build process.

With PHP, searching fast found this library, PHP-Packer .

Basically with it you pass the javascript code and it returns you the obfuscated code.

 $js = file_get_contents('test.js');
 $packer = new Tholu\Packer\Packer($js, 'Normal', true, false, true);
 $packed_js = $packer->pack();
 echo $packed_js;
    
13.10.2018 / 17:57