def safe_base64_decode(s): # 先判断长度是不是4的倍数 if len(s) % 4 != 0: # 如果不是,则需要用=补足 nums = 4 - len(s) % 4 for i in range(nums + 1): s = s + b'=' return base64.urlsafe_b64decode(s)
Sign in to make a reply
烈可烈