Skip to Content
Hands-On Blockchain for Python Developers
book

Hands-On Blockchain for Python Developers

by Arjuna Sky Kok
February 2019
Intermediate to advanced
450 pages
9h 59m
English
Packt Publishing
Content preview from Hands-On Blockchain for Python Developers

Base58

The last thing we need to learn is base58. Base58 is a modified version of base64. This is usually used to encode the binary data as an ASCII string. The following code block is used to encode b'i love you' as an ASCII string:

>>> import base64>>> base64.b64encode(b'i love you')b'aSBsb3ZlIHlvdQ=='

The base64 module is part of the Python standard library.

Usually, you will not encode another ASCII string with base64. Instead, you will encode binary data, such as an image file. If you open cat.jpg with the text editor, you would get gibberish text similar to the text that's shown in the following screenshot:

This is a perfect example ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Blockchain in Action

Blockchain in Action

Bina Ramamurthy
Learn Python by Building a Blockchain and Cryptocurrency

Learn Python by Building a Blockchain and Cryptocurrency

Academind by Maximilian Schwarzmüller GmbH

Publisher Resources

ISBN: 9781788627856Supplemental Content