Underc0de

Programación General => Otros lenguajes => Mensaje iniciado por: Sanko en Febrero 26, 2014, 02:29:05 PM

Título: Cifrado cesar - haskell
Publicado por: Sanko en Febrero 26, 2014, 02:29:05 PM
Simple práctica del lenguaje, ya se que soy pesao repitiendo siempre mismos ciphers

Código (haskell) [Seleccionar]
module Cesar where
import Data.Char
xEnc :: String -> Int -> String
xEnc z y = [chr ((ord x + y) `mod` 256) | x <- z]

xDec :: String -> Int -> String
xDec z y = [chr ((ord x - y) `mod` 256) | x <- z]