Commit a2e22e71 authored by Medicean's avatar Medicean

(Enhance: Core/CMDLINUX) 内置hex解码器增加python3

parent 71fce915
......@@ -9,7 +9,14 @@
* @returns {string} asenc 加密返回数据的函数
*/
asoutput: () => {
return `asenc(){ xxd -ps "$@"; };`
return `asenc(){
command_exists() { command -v "$@" > /dev/null 2>&1; };
if command_exists xxd; then
xxd -ps "$@";
elif command_exists python3; then
echo -n "$@"|python3 -c "import sys, binascii; sys.stdout.buffer.write(binascii.hexlify(input().strip().encode()))";
fi
};`.replace(/\n\s+/g, '')
},
/**
* 解码 Buffer
......
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