Commit 31f65fa9 authored by Medicean's avatar Medicean

添加PHP CHR16 编码器

parent 4748db2c
/**
* php::chr16编码器
* ? 利用php的chr函数进行编码处理
*/
'use strict'
module.exports = (pwd, data) => {
// 编码函数
const encode = (php) => {
let ret = [];
let i = 0;
while(i < php.length) {
ret.push(php[i].charCodeAt().toString(16));
i ++;
}
return `eVAl(cHr(0x${ret.join(').ChR(0x')}));`;
}
// 编码并去除多余数据
data[pwd] = encode(data._);
delete data._;
// 返回数据
return data;
}
...@@ -35,7 +35,7 @@ class PHP extends Base { ...@@ -35,7 +35,7 @@ class PHP extends Base {
* @return {array} 编码器列表 * @return {array} 编码器列表
*/ */
get encoders() { get encoders() {
return ['chr', 'base64']; return ['chr', 'chr16', 'base64'];
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment