新增base64_encode工具

This commit is contained in:
monlor
2020-03-05 11:27:27 +08:00
parent 87780e0cbc
commit af3be34c84
6 changed files with 21 additions and 4 deletions

View File

@@ -281,9 +281,25 @@ parse_str() {
} }
base_encode() { base_encode() {
[ -z "${1}" ] && echo -n "" || echo -n "$*" | baseutil --b64 if [ -z "${1}" ]; then
echo -n ""
else
if command -v base64_encode &> /dev/null; then
echo -n "$*" | base64_encode
else
echo -n "$*" | baseutil --b64
fi
fi
} }
base_decode() { base_decode() {
[ -z "${1}" ] && echo -n "" || echo -n "$*" | baseutil --b64 -d if [ -z "${1}" ]; then
echo -n ""
else
if command -v base64_decode &> /dev/null; then
echo -n "$*" | base64_decode
else
echo -n "$*" | baseutil --b64 -d
fi
fi
} }

View File

@@ -0,0 +1 @@
base64_encode

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -3,5 +3,5 @@ appname="mixbox"
needver="" needver=""
supports="linux_arm,linux_mips,linux_x86_64" supports="linux_arm,linux_mips,linux_x86_64"
appinfo="一款支持多平台多架构的Shell工具箱" appinfo="一款支持多平台多架构的Shell工具箱"
newinfo="新增功能parse_str用于解析变量新增baseutils工具" newinfo="新增base64_encode工具"
version="0.1.5" version="0.1.6"