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.1

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.1
File Size Uploaded
base58-2.1.1.tar.gz 6.5 kB Details

Built distribution (wheel)

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

Total release size: 12.1 kB

Release files / base58-2.1.1.tar.gz

Download URL base58-2.1.1.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c5d0cb3f5b6e81e8e35da5754388ddcc6d0d14b6c6a132cb93d69ed580a7278c
BLAKE2b-256 checksum
How to use checksums
7f458ae61209bb9015f516102fa559a2914178da1d5868428bd86a1b4421141d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

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

Download URL base58-2.1.1-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
11a36f4d3ce51dfc1043f3218591ac4eb1ceb172919cebe05b52a5bcc8d245c2
BLAKE2b-256 checksum
How to use checksums
4a45ec96b29162a402fc4c1c5512d114d7b3787b9d1c2ec241d9568b4816ee23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release history Release notifications | RSS feed

This release

2.1.1 This release

2 release files

2.1.0

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