• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

mikrofusion/gulp-obfuscate: gulp plugin to obfuscate your code using gulp-regex- ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

mikrofusion/gulp-obfuscate

开源软件地址(OpenSource Url):

https://github.com/mikrofusion/gulp-obfuscate

开源编程语言(OpenSource Language):

JavaScript 59.7%

开源软件介绍(OpenSource Introduction):

gulp-obfuscate NPM version Build Status

gulp plugin to obfuscate your code.

Install

$ npm install --save-dev gulp-obfuscate

Usage

var gulp = require('gulp');
var obfuscate = require('gulp-obfuscate');

gulp.task('default', function () {
	return gulp.src('test.js')
		.pipe(obfuscate());
});

Example

gulp-obfuscate obfuscates your javascript code so that it looks like this:

  function ಠ_ಠ4() {
    var ಠ_ಠ1, ಠ_ಠ2, ಠ_ಠ3;
    ...
    ಠ_ಠ3 = ಠ_ಠ1 + ಠ_ಠ2;
    return ಠ_ಠ3;
  }

and this:

  function H͇̬͔̳̖̅̒ͥͧẸ̖͇͈͍̱̭̌͂͆͊_C͈OM̱̈́͛̈ͩ͐͊ͦEͨ̓̐S̬̘͍͕͔͊̆̑̈́̅4() {
    var H͇̬͔̳̖̅̒ͥͧẸ̖͇͈͍̱̭̌͂͆͊_C͈OM̱̈́͛̈ͩ͐͊ͦEͨ̓̐S̬̘͍͕͔͊̆̑̈́̅1, H͇̬͔̳̖̅̒ͥͧẸ̖͇͈͍̱̭̌͂͆͊_C͈OM̱̈́͛̈ͩ͐͊ͦEͨ̓̐S̬̘͍͕͔͊̆̑̈́̅2, H͇̬͔̳̖̅̒ͥͧẸ̖͇͈͍̱̭̌͂͆͊_C͈OM̱̈́͛̈ͩ͐͊ͦEͨ̓̐S̬̘͍͕͔͊̆̑̈́̅3;
    ...
    H͇̬͔̳̖̅̒ͥͧẸ̖͇͈͍̱̭̌͂͆͊_C͈OM̱̈́͛̈ͩ͐͊ͦEͨ̓̐S̬̘͍͕͔͊̆̑̈́̅3 = H͇̬͔̳̖̅̒ͥͧẸ̖͇͈͍̱̭̌͂͆͊_C͈OM̱̈́͛̈ͩ͐͊ͦEͨ̓̐S̬̘͍͕͔͊̆̑̈́̅1 + H͇̬͔̳̖̅̒ͥͧẸ̖͇͈͍̱̭̌͂͆͊_C͈OM̱̈́͛̈ͩ͐͊ͦEͨ̓̐S̬̘͍͕͔͊̆̑̈́̅2;
    return H͇̬͔̳̖̅̒ͥͧẸ̖͇͈͍̱̭̌͂͆͊_C͈OM̱̈́͛̈ͩ͐͊ͦEͨ̓̐S̬̘͍͕͔͊̆̑̈́̅3;
  }

--

See a working example here

--

API

obfuscate(options)

options.replaceMethod

Type: ZALGO or LOOK_OF_DISAPPROVAL

Default: LOOK_OF_DISAPPROVAL

Example:

obfuscate = require('gulp-obfuscate');
...
.pipe(obfuscate({ replaceMethod: obfuscate.ZALGO }))
...

Note: Both obfuscation methods create valid javascript variables per ECMAScript 5.1. That said, there is no guarantee that older browsers can handle the mighty power of ZALGO.

options.exclude

Type: String or Array of Strings

Default: 'break', 'case', 'catch', 'continue', 'debugger', 'default', 'delete', 'do', 'else', 'finally', 'for', 'function', 'if', 'in', 'instanceof', 'new', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'var', 'void', 'while', 'with', 'prototype', 'null', 'true', 'false', 'NaN', 'undefined', 'Infinity', 'ಠ_ಠ', 'H͇̬͔̳̖̅̒ͥͧẸ̖͇͈͍̱̭̌͂͆͊_C͈OM̱̈́͛̈ͩ͐͊ͦEͨ̓̐S̬̘͍͕͔͊̆̑̈́̅'

Values: do_not_replace, abc, ...

Regular expressions to be globally excluded from obfuscation. Current defaults include javascript reserved words. Custom exclusions are often needed for variables or functions that need to stay named the same (such as interfaces to other code).

Note: defaults will be automatically appended to any options.exclude variables provided.

See gulp-regex-replace documentation for more details.

License

MIT © Mike Groseclose




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap