An open API service indexing awesome lists of open source software.

https://github.com/kevingimbel/caesar-cipher

Little Haskell Library to perform caesar cipher on strings
https://github.com/kevingimbel/caesar-cipher

ciphertext haskell library

Last synced: about 1 month ago
JSON representation

Little Haskell Library to perform caesar cipher on strings

Awesome Lists containing this project

README

          

# CaesarCipher

- [Usage](#usage)
- [Function signatures](#function-signatures)
- [encode](#encode)
- [decode](#decode)
- [Example](#example)
- [Links](#links)

Haskell library to perform a [Caesar Cipher](https://en.wikipedia.org/wiki/Caesar_cipher) on text.

## Usage

### Function signatures

#### encode

```hs
-- [Char] = String to encode
-- Int = Number of letters to shift by
encode :: [Char] -> Int -> [Char]
```

#### decode

```hs

-- [Char] = String to decode
-- Int = Number of letters the string was shifted by
decode :: [Char] -> Int -> [Char]
```

### Example

```hs
import CaesarCipher (encode, deoce)

main :: IO ()
main = do
putStrLn (encode "Hello World" 12)
putStrLn (decode "Tqxxa Iadxp" 12)
```

## Links

- [Blog post about the original implementation](https://kevingimbel.de/blog/2024/06/learning-haskell-caesar-cipher/)