ppad-base58-0.2.0: base58 and base58check encoding/decoding.
Copyright(c) 2024 Jared Tobin
LicenseMIT
MaintainerJared Tobin <jared@ppad.tech>
Safe HaskellNone
LanguageHaskell2010

Data.ByteString.Base58

Description

base58 encoding and decoding of strict bytestrings.

Synopsis

Documentation

encode :: ByteString -> ByteString Source #

Encode a base256 ByteString as base58.

>>> encode "hello world"
"StV1DL6CwTryKyV"

decode :: ByteString -> Maybe ByteString Source #

Decode a base58 ByteString to base256.

Invalid inputs will produce Nothing.

>>> decode "StV1DL6CwTryKyV"
Just "hello world"
>>> decode "StV1DL0CwTryKyV" -- s/6/0
Nothing