.b2a_uu()

Anonymous contributor's avatar
Anonymous contributor
Published May 21, 2024
Contribute to Docs

The .b2a_uu() function converts binary data into a bytes object containing a string of ASCII characters in UUEncoded format.

Syntax

binascii.b2a_uu(data, *, backtick=false)
  • data: A bytes object containing the binary data to be encoded.
  • *: This indicates that any arguments following it must be passed using keyword syntax.
  • backtick: When set to True, it replaces zero bytes in the UUEncoded data with a backtick character (`).

Example

import binascii
# Create binary data to encode
binaryData = b"some text"
# Encode the binary data to UUEncoded ASCII format
encodedData = binascii.b2a_uu(binaryData)
print(encodedData)

This produces the following output:

b')<V]M92!T97AT\n'

Note: To learn how to convert back to binary format, visit .a2b_uu().

Codebyte Example

Code
Output
Loading...

All contributors

Contribute to Docs

Learn Python on Codecademy