{
    "content": [
        {
            "type": "text",
            "text": "# base64 (pydoc)\n\n## TLDR\n\n> Encode or decode file or `stdin` to/from base64, to `stdout`.\n\n- Encode a file:\n  `base64 {{path/to/file}}`\n- Wrap encoded output at a specific width (`0` disables wrapping):\n  `base64 {{-w|--wrap}} {{0|76|...}} {{path/to/file}}`\n- Decode a file:\n  `base64 {{-d|--decode}} {{path/to/file}}`\n- Encode from `stdin`:\n  `{{command}} | base64`\n- Decode from `stdin`:\n  `{{command}} | base64 {{-d|--decode}}`\n\n*Source: tldr-pages*\n\n---\n\n**Summary:** base64 - Base16, Base32, Base64 (RFC 3548), Base85 and Ascii85 data encodings\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **MODULE REFERENCE** (8 lines)\n- **FUNCTIONS** (1 lines) — 20 subsections\n  - a85decode (15 lines)\n  - a85encode (16 lines)\n  - b16decode (9 lines)\n  - b16encode (2 lines)\n  - b32decode (17 lines)\n  - b32encode (2 lines)\n  - b32hexdecode (9 lines)\n  - b32hexencode (2 lines)\n  - b64decode (14 lines)\n  - b64encode (6 lines)\n  - b85decode (4 lines)\n  - b85encode (5 lines)\n  - decode (2 lines)\n  - decodebytes (2 lines)\n  - encode (2 lines)\n  - encodebytes (3 lines)\n  - standard_b64decode (7 lines)\n  - standard_b64encode (4 lines)\n  - urlsafe_b64decode (10 lines)\n  - urlsafe_b64encode (6 lines)\n- **DATA** (2 lines)\n- **FILE** (3 lines)\n\n## Full Content\n\n### NAME\n\nbase64 - Base16, Base32, Base64 (RFC 3548), Base85 and Ascii85 data encodings\n\n### MODULE REFERENCE\n\nhttps://docs.python.org/3.10/library/base64.html\n\nThe following documentation is automatically generated from the Python\nsource files.  It may be incomplete, incorrect or include features that\nare considered implementation detail and may vary between Python\nimplementations.  When in doubt, consult the module reference at the\nlocation listed above.\n\n### FUNCTIONS\n\n#### a85decode\n\nDecode the Ascii85 encoded bytes-like object or ASCII string b.\n\nfoldspaces is a flag that specifies whether the 'y' short sequence should be\naccepted as shorthand for 4 consecutive spaces (ASCII 0x20). This feature is\nnot supported by the \"standard\" Adobe encoding.\n\nadobe controls whether the input sequence is in Adobe Ascii85 format (i.e.\nis framed with <~ and ~>).\n\nignorechars should be a byte string containing characters to ignore from the\ninput. This should only contain whitespace characters, and by default\ncontains all whitespace characters in ASCII.\n\nThe result is returned as a bytes object.\n\n#### a85encode\n\nEncode bytes-like object b using Ascii85 and return a bytes object.\n\nfoldspaces is an optional flag that uses the special short sequence 'y'\ninstead of 4 consecutive spaces (ASCII 0x20) as supported by 'btoa'. This\nfeature is not supported by the \"standard\" Adobe encoding.\n\nwrapcol controls whether the output should have newline (b'\\n') characters\nadded to it. If this is non-zero, each output line will be at most this\nmany characters long.\n\npad controls whether the input is padded to a multiple of 4 before\nencoding. Note that the btoa implementation always pads.\n\nadobe controls whether the encoded byte sequence is framed with <~ and ~>,\nwhich is used by the Adobe implementation.\n\n#### b16decode\n\nDecode the Base16 encoded bytes-like object or ASCII string s.\n\nOptional casefold is a flag specifying whether a lowercase alphabet is\nacceptable as input.  For security purposes, the default is False.\n\nThe result is returned as a bytes object.  A binascii.Error is raised if\ns is incorrectly padded or if there are non-alphabet characters present\nin the input.\n\n#### b16encode\n\nEncode the bytes-like object s using Base16 and return a bytes object.\n\n#### b32decode\n\nDecode the base32 encoded bytes-like object or ASCII string s.\n\nOptional casefold is a flag specifying whether a lowercase alphabet is\nacceptable as input.  For security purposes, the default is False.\n\nRFC 3548 allows for optional mapping of the digit 0 (zero) to the\nletter O (oh), and for optional mapping of the digit 1 (one) to\neither the letter I (eye) or letter L (el).  The optional argument\nmap01 when not None, specifies which letter the digit 1 should be\nmapped to (when map01 is not None, the digit 0 is always mapped to\nthe letter O).  For security purposes the default is None, so that\n0 and 1 are not allowed in the input.\n\nThe result is returned as a bytes object.  A binascii.Error is raised if\nthe input is incorrectly padded or if there are non-alphabet\ncharacters present in the input.\n\n#### b32encode\n\nEncode the bytes-like objects using base32 and return a bytes object.\n\n#### b32hexdecode\n\nDecode the base32hex encoded bytes-like object or ASCII string s.\n\nOptional casefold is a flag specifying whether a lowercase alphabet is\nacceptable as input.  For security purposes, the default is False.\n\nThe result is returned as a bytes object.  A binascii.Error is raised if\nthe input is incorrectly padded or if there are non-alphabet\ncharacters present in the input.\n\n#### b32hexencode\n\nEncode the bytes-like objects using base32hex and return a bytes object.\n\n#### b64decode\n\nDecode the Base64 encoded bytes-like object or ASCII string s.\n\nOptional altchars must be a bytes-like object or ASCII string of length 2\nwhich specifies the alternative alphabet used instead of the '+' and '/'\ncharacters.\n\nThe result is returned as a bytes object.  A binascii.Error is raised if\ns is incorrectly padded.\n\nIf validate is False (the default), characters that are neither in the\nnormal base-64 alphabet nor the alternative alphabet are discarded prior\nto the padding check.  If validate is True, these non-alphabet characters\nin the input result in a binascii.Error.\n\n#### b64encode\n\nEncode the bytes-like object s using Base64 and return a bytes object.\n\nOptional altchars should be a byte string of length 2 which specifies an\nalternative alphabet for the '+' and '/' characters.  This allows an\napplication to e.g. generate url or filesystem safe Base64 strings.\n\n#### b85decode\n\nDecode the base85-encoded bytes-like object or ASCII string b\n\nThe result is returned as a bytes object.\n\n#### b85encode\n\nEncode bytes-like object b in base85 format and return a bytes object.\n\nIf pad is true, the input is padded with b'\\0' so its length is a multiple of\n4 bytes before encoding.\n\n#### decode\n\nDecode a file; input and output are binary files.\n\n#### decodebytes\n\nDecode a bytestring of base-64 data into a bytes object.\n\n#### encode\n\nEncode a file; input and output are binary files.\n\n#### encodebytes\n\nEncode a bytestring into a bytes object containing multiple lines\nof base-64 data.\n\n#### standard_b64decode\n\nDecode bytes encoded with the standard Base64 alphabet.\n\nArgument s is a bytes-like object or ASCII string to decode.  The result\nis returned as a bytes object.  A binascii.Error is raised if the input\nis incorrectly padded.  Characters that are not in the standard alphabet\nare discarded prior to the padding check.\n\n#### standard_b64encode\n\nEncode bytes-like object s using the standard Base64 alphabet.\n\nThe result is returned as a bytes object.\n\n#### urlsafe_b64decode\n\nDecode bytes using the URL- and filesystem-safe Base64 alphabet.\n\nArgument s is a bytes-like object or ASCII string to decode.  The result\nis returned as a bytes object.  A binascii.Error is raised if the input\nis incorrectly padded.  Characters that are not in the URL-safe base-64\nalphabet, and are not a plus '+' or slash '/', are discarded prior to the\npadding check.\n\nThe alphabet uses '-' instead of '+' and '' instead of '/'.\n\n#### urlsafe_b64encode\n\nEncode bytes using the URL- and filesystem-safe Base64 alphabet.\n\nArgument s is a bytes-like object to encode.  The result is returned as a\nbytes object.  The alphabet uses '-' instead of '+' and '' instead of\n'/'.\n\n### DATA\n\nall = ['encode', 'decode', 'encodebytes', 'decodebytes', 'b64encod...\n\n### FILE\n\n/usr/lib/python3.10/base64.py\n\n"
        }
    ],
    "structuredContent": {
        "command": "base64",
        "section": "",
        "mode": "pydoc",
        "summary": "base64 - Base16, Base32, Base64 (RFC 3548), Base85 and Ascii85 data encodings",
        "synopsis": null,
        "tldr_summary": "Encode or decode file or `stdin` to/from base64, to `stdout`.",
        "tldr_examples": [
            {
                "description": "Encode a file",
                "command": "base64 {{path/to/file}}"
            },
            {
                "description": "Wrap encoded output at a specific width (`0` disables wrapping)",
                "command": "base64 {{-w|--wrap}} {{0|76|...}} {{path/to/file}}"
            },
            {
                "description": "Decode a file",
                "command": "base64 {{-d|--decode}} {{path/to/file}}"
            },
            {
                "description": "Encode from `stdin`",
                "command": "{{command}} | base64"
            },
            {
                "description": "Decode from `stdin`",
                "command": "{{command}} | base64 {{-d|--decode}}"
            }
        ],
        "tldr_source": "official",
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "MODULE REFERENCE",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "FUNCTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "a85decode",
                        "lines": 15
                    },
                    {
                        "name": "a85encode",
                        "lines": 16
                    },
                    {
                        "name": "b16decode",
                        "lines": 9
                    },
                    {
                        "name": "b16encode",
                        "lines": 2
                    },
                    {
                        "name": "b32decode",
                        "lines": 17
                    },
                    {
                        "name": "b32encode",
                        "lines": 2
                    },
                    {
                        "name": "b32hexdecode",
                        "lines": 9
                    },
                    {
                        "name": "b32hexencode",
                        "lines": 2
                    },
                    {
                        "name": "b64decode",
                        "lines": 14
                    },
                    {
                        "name": "b64encode",
                        "lines": 6
                    },
                    {
                        "name": "b85decode",
                        "lines": 4
                    },
                    {
                        "name": "b85encode",
                        "lines": 5
                    },
                    {
                        "name": "decode",
                        "lines": 2
                    },
                    {
                        "name": "decodebytes",
                        "lines": 2
                    },
                    {
                        "name": "encode",
                        "lines": 2
                    },
                    {
                        "name": "encodebytes",
                        "lines": 3
                    },
                    {
                        "name": "standard_b64decode",
                        "lines": 7
                    },
                    {
                        "name": "standard_b64encode",
                        "lines": 4
                    },
                    {
                        "name": "urlsafe_b64decode",
                        "lines": 10
                    },
                    {
                        "name": "urlsafe_b64encode",
                        "lines": 6
                    }
                ]
            },
            {
                "name": "DATA",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "FILE",
                "lines": 3,
                "subsections": []
            }
        ]
    }
}