Skip to main content

Reference implementation of CB58 encoding used by AVA

Project description

cb58ref

https://img.shields.io/pypi/v/cb58ref.svg https://img.shields.io/travis/moreati/cb58ref.svg Documentation Status Updates

cb58ref is a reference implementation of the CB58 encoding used by AVA. CB58 is similar to the Base58Check encoding used in Bitcoin

  • both can encode arbitrary an arbitrary byte sequence

  • both use the same alphabet

  • both append a 4 byte checksum

they differ in the following respects

  • CB58 uses the final 4 bytes of SHA256(msg) as the checksum. Base58Check uses the first 4 bytes of SHA256(SHA256(msg)) as the checksum.

Usage

>>> import cb58ref
>>> cb58ref.cb58encode(b"Hello world"):
'32UWxgjUJd9s6Kyvxjj1u'
>>> cb58ref.cb58decode('32UWxgjUJd9s6Kyvxjj1u')
b"Hello world"
$ printf "Hello world" | python3 -m cb58ref
32UWxgjUJd9s6Kyvxjj1u

$ printf "32UWxgjUJd9s6Kyvxjj1u" | python3 -m cb58ref -d
Hello world

Installation

$ python3 -m pip install cb58ref

License

  • Free software: MIT license

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template. The b58decode(), and b58encode() functions are from base58.py, part of Bitcoin Core.

History

0.2.0 (2020-06-17)

  • Command line interface

  • Type hints

  • Unit tests

0.1.0 (2020-06-15)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cb58ref-0.2.0.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

cb58ref-0.2.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file cb58ref-0.2.0.tar.gz.

File metadata

  • Download URL: cb58ref-0.2.0.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.8

File hashes

Hashes for cb58ref-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3880111ca4dcda7d459f45610a49e6070de90ed52c23e89e11a4a34080378056
MD5 94a4103c3cf7dbbc92a9f33339b66255
BLAKE2b-256 255c0449b274bbb885215a349d9a76861341e2500a48eb4b1641f7cdcf78816b

See more details on using hashes here.

File details

Details for the file cb58ref-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: cb58ref-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.8

File hashes

Hashes for cb58ref-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c4e3ab7bc7eca8bc9fecaac18d3909616fef6a36804b0b5927a46fa3cad2df82
MD5 39c519f7f0d0445e20ef0277224d79da
BLAKE2b-256 39d2ddb746797433a95b49b6fcb8947aad3eb4a2cfbcebc5663dbf87addf76ad

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page