https://github.com/nicxlau/hunter-php-javascript-obfuscator
:lock: Protect your JavaScript source code with the simplest and fastest way.
https://github.com/nicxlau/hunter-php-javascript-obfuscator
hacktoberfest hunter-php-obfuscator obfuscator php
Last synced: 7 months ago
JSON representation
:lock: Protect your JavaScript source code with the simplest and fastest way.
- Host: GitHub
- URL: https://github.com/nicxlau/hunter-php-javascript-obfuscator
- Owner: nicxlau
- Created: 2019-09-01T23:08:40.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-08-08T03:02:04.000Z (over 3 years ago)
- Last Synced: 2024-07-25T02:54:01.677Z (over 1 year ago)
- Topics: hacktoberfest, hunter-php-obfuscator, obfuscator, php
- Language: PHP
- Homepage:
- Size: 14.6 KB
- Stars: 71
- Watchers: 3
- Forks: 37
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hunter - PHP Javascript Obfuscator
> :lock: Protect your JavaScript source code with the simplest and fastest way.
### :squirrel: [Investigate the live demo](https://damidev.000webhostapp.com/)
## Requirement
```php
require_once 'HunterObfuscator.php'; //Include the class
```
## Simple usage to obfuscate JS code:
```php
$jsCode = "alert('Hello world!');"; //Simple JS code
$hunter = new HunterObfuscator($jsCode); //Initialize with JS code in parameter
$obsfucated = $hunter->Obfuscate(); //Do obfuscate and get the obfuscated code
echo "" . $obsfucated . "";
```
## Simple usage to obfuscate HTML code:
```php
$htmlCode = "
Title
Hello world!
"; //Simple HTML code
$hunter = new HunterObfuscator($htmlCode, true); //Initialize with HTML code in first parameter and set second one to TRUE
$obsfucated = $hunter->Obfuscate(); //Do obfuscate and get the obfuscated code
echo "" . $obsfucated . "";
```
> **Note**: If your HTML code contains any JS codes please remove any comments in that js code to prevent issues.
## Set expiration time:
```php
$hunter->setExpiration('+10 day'); //Expires after 10 days
$hunter->setExpiration('Next Friday'); //Expires next Friday
$hunter->setExpiration('tomorrow'); //Expires tomorrow
$hunter->setExpiration('+5 hours'); //Expires after 5 hours
$hunter->setExpiration('+1 week 3 days 7 hours 5 seconds'); //Expires after +1 week 3 days 7 hours and 5 seconds
```
## Domain name lock:
```php
$hunter->addDomainName('google.com'); //the generated code will work only on google.com
```
> **Note**: you can add multiple domains by adding one by one.
#### See the included demo (/original/index.php) for more.
#### Happy Coding :)
## CHANGE LOG (YYYY/MM/DD)
* v1.2 - **2018-01-11**
* fixed utf8 characters
* v1.1 - **2017-11-20**
* Some improvments
* Added expiration time
* Added domain name lock
* Added ability to obfuscate HTML code
* New demo script
* v1.0 - **2017-07-27**
* Initial release