-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Implementation of BASE58 transcoding for ByteStrings
--   
--   Implementation of BASE58 transcoding copy-pasted from haskoin package
@package base58-bytestring
@version 0.1.0

module Data.ByteString.Base58.Internal
newtype Alphabet
Alphabet :: ByteString -> Alphabet
[unAlphabet] :: Alphabet -> ByteString
bitcoinAlphabet :: Alphabet
rippleAlphabet :: Alphabet
flickrAlphabet :: Alphabet

-- | Take <tt>i</tt> byte from alphabet
b58 :: Alphabet -> Int -> Word8

-- | Lookup position of byte <tt>w</tt> in alphabet
b58' :: Alphabet -> Word8 -> Maybe Int

-- | Decode a big endian Integer from a bytestring
bsToInteger :: ByteString -> Integer

-- | Encode an Integer to a bytestring as big endian
integerToBS :: Integer -> ByteString
instance Data.String.IsString Data.ByteString.Base58.Internal.Alphabet
instance GHC.Generics.Generic Data.ByteString.Base58.Internal.Alphabet
instance GHC.Show.Show Data.ByteString.Base58.Internal.Alphabet
instance GHC.Classes.Eq Data.ByteString.Base58.Internal.Alphabet
instance GHC.Classes.Ord Data.ByteString.Base58.Internal.Alphabet

module Data.ByteString.Base58
newtype Alphabet
Alphabet :: ByteString -> Alphabet
[unAlphabet] :: Alphabet -> ByteString
bitcoinAlphabet :: Alphabet
rippleAlphabet :: Alphabet
flickrAlphabet :: Alphabet

-- | Encode a bytestring to a base 58 representation.
encodeBase58 :: Alphabet -> ByteString -> ByteString

-- | Decode a base 58 encoded bytestring. This can fail if the input
--   bytestring contains invalid base 58 characters such as 0,O,l,I
decodeBase58 :: Alphabet -> ByteString -> Maybe ByteString
encodeBase58I :: Alphabet -> Integer -> ByteString
decodeBase58I :: Alphabet -> ByteString -> Maybe Integer
