import uuid
import base64
# uuid4()生成32位的随机加密串
uuid_str = str(uuid.uuid4()).encode("utf-8")
print(uuid_str)
# 使用base64加密
result = base64.b64encode(uuid_str)
print(result)
# 使用base64解密,并转换为str
result = base64.b64decode(result)
print(result.decode("utf-8"))
python uuid和base64的加解密
猜你喜欢
转载自blog.csdn.net/qq_43534980/article/details/115145375
今日推荐
周排行