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
- Host: GitHub
- URL: https://github.com/kevingimbel/caesar-cipher
- Owner: KevinGimbel
- License: mit
- Created: 2024-06-23T20:56:33.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-24T07:53:25.000Z (over 1 year ago)
- Last Synced: 2025-01-22T08:37:40.618Z (about 1 year ago)
- Topics: ciphertext, haskell, library
- Language: Haskell
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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/)