Skip to main content

base58

PyPI Version PyPI Downloads Build Status Coverage Status

Base58 and Base58Check implementation compatible with what is used by the bitcoin network. Any other alternative alphabet (like the XRP one) can be used.

Starting from version 2.0.0 python2 is no longer supported the 1.x series will remain supported but no new features will be added.

Command line usage

$ printf "hello world" | base58
StV1DL6CwTryKyV

$ printf "hello world" | base58 -c
3vQB7B6MrGQZaxCuFg4oh

$ printf "3vQB7B6MrGQZaxCuFg4oh" | base58 -dc
hello world

$ printf "4vQB7B6MrGQZaxCuFg4oh" | base58 -dc
Invalid checksum

Module usage

>>> import base58
>>> base58.b58encode(b'hello world')
b'StV1DL6CwTryKyV'
>>> base58.b58decode(b'StV1DL6CwTryKyV')
b'hello world'
>>> base58.b58encode_check(b'hello world')
b'3vQB7B6MrGQZaxCuFg4oh'
>>> base58.b58decode_check(b'3vQB7B6MrGQZaxCuFg4oh')
b'hello world'
>>> base58.b58decode_check(b'4vQB7B6MrGQZaxCuFg4oh')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "base58.py", line 89, in b58decode_check
    raise ValueError("Invalid checksum")
ValueError: Invalid checksum
# Use another alphabet. Here, using the built-in XRP/Ripple alphabet.
# RIPPLE_ALPHABET is provided as an option for compatibility with existing code
# It is recommended to use XRP_ALPHABET instead
>>> base58.b58encode(b'hello world', alphabet=base58.XRP_ALPHABET)
b'StVrDLaUATiyKyV'
>>> base58.b58decode(b'StVrDLaUATiyKyV', alphabet=base58.XRP_ALPHABET)
b'hello world'

Metadata

Release files for base58 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for base58 2.1.0
File Size Uploaded
base58-2.1.0.tar.gz 6.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for base58 2.1.0
File Interpreter ABI Platform
base58-2.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.0 kB

Release files / base58-2.1.0.tar.gz

Download URL base58-2.1.0.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
171a547b4a3c61e1ae3807224a6f7aec75e364c4395e7562649d7335768001a2
BLAKE2b-256 checksum
How to use checksums
b5c18e77d5389cf1ea2535049e5ffaeb241cce21bcc1c42624b3e8d0fb3bb607
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.9

Release files / base58-2.1.0-py3-none-any.whl

Download URL base58-2.1.0-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8225891d501b68c843ffe30b86371f844a21c6ba00da76f52f9b998ba771fb48
BLAKE2b-256 checksum
How to use checksums
b8a1d9f565e9910c09fd325dc638765e8843a19fa696275c16cc08cf3b0a3c25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.9

Release history Release notifications | RSS feed

2.1.1

2 release files

This release

2.1.0 This release

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.3

3 release files

1.0.2

3 release files

1.0.1

3 release files

1.0.0

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page