base58string-0.9.0: Fast and safe representation of a Base-58 string

Safe HaskellNone
LanguageHaskell2010

Data.Base58String

Synopsis

Documentation

data Base58String Source

Represents a Base58 string. Guarantees that all characters it contains are valid base58 characters.

b58String :: ByteString -> Base58String Source

Smart constructor which validates that all the text are actually base-58 characters.

fromBinary :: Binary a => a -> Base58String Source

Converts a Binary to a Base58String value

toBinary :: Binary a => Base58String -> a Source

Converts a Base58String to a Binary value

fromBytes :: ByteString -> Base58String Source

Reads a ByteString as raw bytes and converts to base58 representation. We cannot use the instance Binary of ByteString because it provides a leading length, which is not what we want when dealing with raw bytes.

toBytes :: Base58String -> ByteString Source

Access to the raw bytes in a ByteString format.

toText :: Base58String -> Text Source

Access to a Text representation of the Base58String