.b2a_uu()

Anonymous contributor's avatar
Anonymous contributor
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

us
Visit us
code
Hide code
Code
Output
Hide output
Hide output
Loading...

All contributors

Looking to contribute?

Learn Python on Codecademy