You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 9, 2023. It is now read-only.
This project is no longer maintained and has been archived.
haskell-multibase
Implementation of multibase -self identifying base encodings- in Haskell.
Install
This library can be built with cabal:
cd path/to/extracted/library
cabal build
if you want to install it:
cabal install
Usage
This library exports the Multibase module which comes with five functions:
multiEncode :: String -> Data.ByteString.ByteString -> Bool -> Data.ByteString.ByteString
-- takes a base encoding and a byteString and returns the encoded byteString with its base prefix
-- Bool is the padding flag (makes a difference only for bases for which padding is standardized)
decodeByteString :: Data.ByteString.ByteString -> Data.ByteString.ByteString
-- takes a multibase-encoded byteString and decodes it (UTF-8), prefix is used to determine encoding
appendPrefix :: String -> Data.ByteString.ByteString -> Data.ByteString.ByteString
-- appends a multibase prefix to a byteString without encoding it
removePrefix :: Data.ByteString.ByteString -> Data.ByteString.ByteString
-- just removes the prefix, be careful not to use it on a non-prefixed byteString