Create conversion.sh

dependabot/github_actions/goreleaser/goreleaser-action-4
fscarmen 3 years ago committed by GitHub
parent 5e6b428e26
commit b85217f81b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 21
      conversion.sh

@ -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…
Cancel
Save