From 252c5e5c68d5d8264795872cfb39963756c555ed Mon Sep 17 00:00:00 2001 From: Stefan Friese Date: Sun, 19 May 2024 13:51:12 +0200 Subject: [PATCH] reworked dec10 and enc10 --- src/Encoding/Base10.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Encoding/Base10.hs b/src/Encoding/Base10.hs index 705b525..3b01212 100644 --- a/src/Encoding/Base10.hs +++ b/src/Encoding/Base10.hs @@ -5,10 +5,10 @@ module Encoding.Base10 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 +dec10 = map (chr . read) . words enc10 :: String -> String -enc10 str = C.unpack $ C.pack $ Prelude.foldl (\acc char -> acc ++ show (ord char)) "" str +enc10 = unwords . map (show . ord) +-- enc10 str = C.unpack $ C.pack $ Prelude.foldl (\acc char -> acc ++ show (ord char)) "" str