承接 octha/obfuscator 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

octha/obfuscator

Composer 安装命令:

composer require octha/obfuscator

包简介

Protect your javascript source code with the simplest and fastest way.

README 文档

README

License Latest Stable Version Total Downloads

Protect your javascript source code with the simplest and fastest way to obfuscate javascript with PHP.

Installation

composer require octha/obfuscator

Usage

Simple usage to obfuscate JS code

$jsCode = "alert('Hello world!');"; //Simple JS code
$hunter = new \Octha\Obfuscator\Factory($jsCode); //Initialize with JS code in parameter
$obsfucated = $hunter->Obfuscate(); //Do obfuscate and get the obfuscated code
echo "<script>" . $obsfucated . "</script>";

Simple usage to obfuscate HTML code

$htmlCode = "<h1>Title</h1><p>Hello world!</p>"; //Simple HTML code
$hunter = new \Octha\Obfuscator\Factory($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 "<script>" . $obsfucated . "</script>";

Note: If your HTML code contains any JS codes please remove any comments in that js code to prevent issues.

Set expiration time

$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

$hunter->addDomainName('google.com'); //the generated code will work only on google.com

Note: you can add multiple domains by adding one by one.

License

This package is licensed under the MIT license © Octha.

统计信息

  • 总下载量: 4.48k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-04-21