Python 3.13+base64function
base64.z85decode()
Ascii85 and Base85
Decodes Z85 (the ZeroMQ Base85 variant) into bytes. The counterpart of z85encode, available since Python 3.13.
Syntax
base64.z85decode(s)
The Z85 alphabet differs from both Ascii85 and git-style Base85, so data encoded with b85encode gives different bytes or an error here. If the code must also run on Python before 3.13, check hasattr(base64, 'z85decode') or keep your own implementation.
Examples
import base64
print(base64.z85decode(b'HelloWorld')) # → b'\x86O\xd2o\xb5Y\xf7['
print(base64.z85decode(base64.z85encode(b'data'))) # → b'data'
See also
Open in the full glossarydocs.python.orgReport an inaccuracy