Commit c2860b8c authored by Medicean's avatar Medicean

(Fix:Custom) 修正内置 decoder 解析

parent 6870e929
......@@ -20,6 +20,6 @@ module.exports = {
* @returns {string} 解码后的 Buffer
*/
decode_buff: (data, ext={}) => {
return Buffer.from(data, 'base64');
return Buffer.from(data.toString(), 'base64');
}
}
\ No newline at end of file
......@@ -20,6 +20,6 @@ module.exports = {
* @returns {string} 解码后的 Buffer
*/
decode_buff: (data, ext={}) => {
return Buffer.from(data, 'hex');
return Buffer.from(data.toString(), 'hex');
}
}
\ No newline at end of file
......@@ -21,6 +21,6 @@ module.exports = {
* @returns {string} 解码后的 Buffer
*/
decode_buff: (data, ext={}) => {
return Buffer.from(Buffer.from(data, 'hex'), 'base64');
return Buffer.from(Buffer.from(data.toString(), 'hex').toString(), 'base64');
}
}
\ No newline at end of file
......@@ -37,7 +37,7 @@ class CUSTOM extends Base {
}
get decoders() {
return ["default"];
return ['default', 'base64', 'hex', 'hex_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