annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/lib/python3.8/site-packages/wheel/util.py @ 68:5028fdace37b

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 16:23:26 -0400
parents
children
rev   line source
jpayne@68 1 from __future__ import annotations
jpayne@68 2
jpayne@68 3 import base64
jpayne@68 4 import logging
jpayne@68 5
jpayne@68 6 log = logging.getLogger("wheel")
jpayne@68 7
jpayne@68 8
jpayne@68 9 def urlsafe_b64encode(data: bytes) -> bytes:
jpayne@68 10 """urlsafe_b64encode without padding"""
jpayne@68 11 return base64.urlsafe_b64encode(data).rstrip(b"=")
jpayne@68 12
jpayne@68 13
jpayne@68 14 def urlsafe_b64decode(data: bytes) -> bytes:
jpayne@68 15 """urlsafe_b64decode without padding"""
jpayne@68 16 pad = b"=" * (4 - (len(data) & 3))
jpayne@68 17 return base64.urlsafe_b64decode(data + pad)