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

Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Base58String

Synopsis

Documentation

data Base58String Source

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

b58String Source

Arguments

:: ByteString

Our Base58 mapping table

-> ByteString

Our Base58 string

-> Base58String 

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

fromBinary Source

Arguments

:: Binary a 
=> ByteString

Our Base58 mapping table

-> a

Input object that is convertable to binary

-> Base58String

Base58 representation of binary data

Converts a Binary to a Base58String value

toBinary Source

Arguments

:: Binary a 
=> ByteString

Base58 mapping table

-> Base58String

Base58 representation

-> a

Converted object

Converts a Base58String to a Binary value

fromBytes Source

Arguments

:: ByteString

Our Base58 mapping table

-> ByteString

Raw binary bytes

-> Base58String

Base58 representation of raw binary bytes

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 Source

Arguments

:: ByteString

Base58 mapping table

-> Base58String

Base58 string we wish to get binary data from

-> ByteString

Raw binary representation

Access to the raw bytes in a ByteString format.

toText :: Base58String -> Text Source

Access to a Text representation of the Base58String

fromText Source

Arguments

:: ByteString

Base58 mapping table

-> Text

Text representation

-> Base58String

Base58 classified representation

Converts a Text representation to a Base58String