packages feed

base91 0.1.1 → 0.2.0

raw patch · 5 files changed

+26/−8 lines, 5 filesdep ~basenew-component:exe:base91PVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base

API changes (from Hackage documentation)

Files

Codec/Binary/Base91/ByteString.hs view
@@ -6,10 +6,10 @@ import qualified Data.ByteString as BS import qualified Data.List as L --- | Encodes octets ('ByteString') to a '[Char]' in Base91; the opposite of 'decode'.+-- | Encodes octets ('ByteString') to a ['Char'] in Base91; the opposite of 'decode'. encode :: BS.ByteString -> [Char] encode = encodeBy BS.foldl' (++) [] --- | Decodes octets ('ByteString') from a '[Char]' in Base91; the opposite of 'encode'.+-- | Decodes octets ('ByteString') from a ['Char'] in Base91; the opposite of 'encode'. decode :: [Char] -> BS.ByteString decode = decodeBy L.foldl' (\bs -> BS.append bs . BS.pack) BS.empty
Codec/Binary/Base91/String.hs view
@@ -6,10 +6,10 @@ import qualified Data.List as L import qualified Data.Word as W --- | Encodes octets ('[Word8]') to a 'String' in Base91; the opposite of 'decode'.+-- | Encodes octets (['Word8']) to a 'String' in Base91; the opposite of 'decode'. encode :: [W.Word8] -> String encode = encodeBy L.foldl' (++) [] --- | Decodes octets ('[Word8]') from a 'String' in Base91; the opposite of 'encode'.+-- | Decodes octets (['Word8']) from a 'String' in Base91; the opposite of 'encode'. decode :: String -> [W.Word8] decode = decodeBy L.foldl' (++) []
Codec/Binary/Base91/Text.hs view
@@ -7,10 +7,10 @@ import qualified Data.Text as T import qualified Data.Word as W --- | Encodes octets ('[Word8]') to 'Text' in Base91; the opposite of 'decode'.+-- | Encodes octets (['Word8']) to 'Text' in Base91; the opposite of 'decode'. encode :: [W.Word8] -> T.Text encode = encodeBy L.foldl' (\t -> T.append t . T.pack) T.empty --- | Decodes octets ('[Word8]') from 'Text' in Base91; the opposite of 'encode'.+-- | Decodes octets (['Word8']) from 'Text' in Base91; the opposite of 'encode'. decode :: T.Text -> [W.Word8] decode = decodeBy T.foldl' (++) []
+ Main.hs view
@@ -0,0 +1,14 @@+-- Copyright 2015 Alvaro J. Genial (http://alva.ro) -- see LICENSE.md for more.++module Main (main) where++import Codec.Binary.Base91.Efficient as Base91+import Data.ByteString as BS+import Data.Text.IO as T+import System.Environment (getArgs)++main :: IO ()+main = getArgs >>= \args -> case args of+  ["encode"] -> BS.getContents >>= T.putStr . Base91.encode+  ["decode"] -> T.getContents >>= BS.putStr . Base91.decode+  _          -> error "invalid arguments"
base91.cabal view
@@ -1,9 +1,9 @@ Name:                  base91-Version:               0.1.1+Version:               0.2.0 Author:                Alvaro J. Genial Maintainer:            ajg Homepage:              https://github.com/ajg/base91-Synopsis:              A Base91 encoder & decoder+Synopsis:              A Base91 Encoder & Decoder Description:           An implementation of Base91 encoding & decoding of arbitrary bytes (octets)                        to/from characters (all in the ASCII printable range; it includes support for                        plain Strings, as well as optional support for ByteString and/or Text; see@@ -36,6 +36,10 @@    if flag(ByteString) && flag(Text)     Exposed-Modules:   Codec.Binary.Base91.Efficient++Executable base91+  Main-is:             Main.hs+  Build-Depends:       base, base91, bytestring, text  Test-Suite tests   Hs-Source-Dirs:      .