Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

based58

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

based58

A fast Python library for Base58 and Base58Check

pipPyPI
Version
0.1.1
Maintainers
1

based58

A fast base-58 Python library

based58 is a fast Python library for Base58 encoding and decoding. It includes support for Base58Check and configurable alphabets.

It is significantly faster than the pure-Python base58 library, as it calls the Rust bs58 library under the hood.

The API mimics that of the base58 library, with the exception that string inputs are not supported, only bytes.

Installation

pip install based58

Note: requires Python >= 3.7.

Usage

>>> import based58
>>> data = [1, 2, 3]
>>> based58.b58encode(b'hello world')
b'StV1DL6CwTryKyV'
>>> based58.b58decode(b'StV1DL6CwTryKyV')
b'hello world'
>>> based58.b58encode_check(b'hello world')
b'3vQB7B6MrGQZaxCuFg4oh'
>>> based58.b58decode_check(b'3vQB7B6MrGQZaxCuFg4oh')
b'hello world'
>>> based58.b58encode(b'hello world', alphabet=based58.Alphabet.RIPPLE)
b'StVrDLaUATiyKyV'
>>> based58.b58decode(b'StVrDLaUATiyKyV', alphabet=based58.Alphabet.RIPPLE)
b'hello world'

Development

Setup

  • Install poetry
  • Install dev dependencies:
poetry install
  • Activate the poetry shell:
poetry shell

Testing

  • Run maturin develop to compile the Rust code.
  • Run make fmt, make lint, and make test.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts