This commit is contained in:
Paweł Iżycki
2015-06-23 13:34:47 +02:00
parent 8cdc7c574d
commit 5bd51c69ae
2 changed files with 16 additions and 0 deletions

15
F#/Program.fs Normal file
View File

@@ -0,0 +1,15 @@
open System
let encrypt (word : string) =
let key = "KCQ"
[ 0..(word.Length - 1) ]
|> Seq.map (fun idx -> Convert.ToChar(Convert.ToInt32 word.[idx] ^^^ Convert.ToInt32 key.[idx % key.Length]))
|> String.Concat
[<EntryPoint>]
let main argv =
let encrypted = encrypt "IzzyDev"
printfn "Encrypted: %s" encrypted
let decrypted = encrypt encrypted
printfn "Decrypted: %s" decrypted
0