mirror of https://gitlab.com/fscarmen/test.git
parent
5e6b428e26
commit
b85217f81b
@ -0,0 +1,21 @@ |
||||
#!/usr/bin/env bash |
||||
read -rp "输入reserved: " RESERVED |
||||
if [ "${#RESERVED}" = 4 ]; then |
||||
cat >./temp.py << EOF |
||||
import base64 |
||||
reserved = "$RESERVED" |
||||
decode = list(base64.b64decode(reserved)) |
||||
print("解码后:") |
||||
print(decode) |
||||
EOF |
||||
else |
||||
cat >./temp.py << EOF |
||||
import base64 |
||||
encoded_bytes = base64.b64encode(bytes($RESERVED)) |
||||
encoded_str = encoded_bytes.decode("utf-8") |
||||
print("编码后:") |
||||
print(encoded_str) |
||||
EOF |
||||
fi |
||||
python3 temp.py |
||||
rm -f temp.py |
||||
Loading…
Reference in new issue