based/src/Encoding/Base10.hs

15 lines
366 B
Haskell
Raw Normal View History

module Encoding.Base10
( enc10
, dec10
) where
import qualified Data.ByteString.Char8 as C
import Data.Char (ord, chr, digitToInt, intToDigit)
dec10 :: String -> String
2024-05-19 13:51:12 +02:00
dec10 = map (chr . read) . words
enc10 :: String -> String
2024-05-19 13:51:12 +02:00
enc10 = unwords . map (show . ord)
-- enc10 str = C.unpack $ C.pack $ Prelude.foldl (\acc char -> acc ++ show (ord char)) "" str