15 lines
372 B
Haskell
15 lines
372 B
Haskell
module Encoding.Base10
|
|
( enc10
|
|
, dec10
|
|
) where
|
|
|
|
import qualified Data.ByteString.Char8 as C
|
|
import Data.Char (ord, chr, digitToInt, intToDigit)
|
|
import Text.XML.HXT.DOM.Util (hexStringToInt)
|
|
|
|
dec10 :: String -> String
|
|
dec10 = show . hexStringToInt
|
|
|
|
enc10 :: String -> String
|
|
enc10 str = C.unpack $ C.pack $ Prelude.foldl (\acc char -> acc ++ show (ord char)) "" str
|