Python Glossary Русский

Python 3.4+base64function

base64.b85decode()

Ascii85 and Base85

Decodes Base85 (the git alphabet) into bytes. The counterpart of b85encode; Ascii85 and Z85 strings do not fit it.

Syntax

base64.b85decode(b)

The three '85' variants in the module, Ascii85, Base85 and Z85, use different alphabets, and the decoder of one either fails on another's data or returns garbage. Zeros added by encoding with pad=True are not removed. Errors are ValueError and its subclasses.

Examples

import base64
print(base64.b85decode(b'Xk~0{Zv'))  # → b'hello'
try:
    base64.b85decode(b'<~BOu!rDZ~>')
except ValueError:
    print('не тот формат')  # → не тот формат

See also

Common errors

Open in the full glossarydocs.python.orgReport an inaccuracy