base16

Pure Haskell base16 encoding/decoding (docs.ppad.tech/base16).
git clone git://git.ppad.tech/base16.git
Log | Files | Refs | README | LICENSE

Weight.hs (1777B)


      1 {-# LANGUAGE OverloadedStrings #-}
      2 {-# LANGUAGE PackageImports #-}
      3 
      4 module Main where
      5 
      6 import qualified Data.ByteString as BS
      7 import qualified "base16-bytestring" Data.ByteString.Base16 as R0
      8 import qualified "base16" Data.ByteString.Base16 as R1
      9 import qualified "ppad-base16" Data.ByteString.Base16 as B16
     10 import qualified Weigh as W
     11 
     12 inp :: BS.ByteString
     13 inp = "jtobin was here benching stuffjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin was here benching stufjtobin w"
     14 
     15 hinp :: BS.ByteString
     16 hinp = B16.encode inp
     17 
     18 main :: IO ()
     19 main = W.mainWith $ do
     20   W.func "ppad-base16 (encode)" B16.encode inp
     21   W.func "base16-bytestring (encode)" R0.encode inp
     22   W.func "base16 (encode)" R1.encodeBase16' inp
     23 
     24   W.func "ppad-base16 (decode)" B16.decode hinp
     25   W.func "base16-bytestring (decode)" R0.decode hinp
     26   W.func "base16 (decode)" R1.decodeBase16Untyped inp