Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
22
Task/Vigen-re-cipher/PicoLisp/vigen-re-cipher.l
Normal file
22
Task/Vigen-re-cipher/PicoLisp/vigen-re-cipher.l
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
(de vigenereKey (Str)
|
||||
(extract
|
||||
'((C)
|
||||
(when (>= "Z" (uppc C) "A")
|
||||
(- (char (uppc C)) 65) ) )
|
||||
(chop Str) ) )
|
||||
|
||||
(de vigenereEncrypt (Str Key)
|
||||
(pack
|
||||
(mapcar
|
||||
'((C K)
|
||||
(char (+ 65 (% (+ C K) 26))) )
|
||||
(vigenereKey Str)
|
||||
(apply circ (vigenereKey Key)) ) ) )
|
||||
|
||||
(de vigenereDecrypt (Str Key)
|
||||
(pack
|
||||
(mapcar
|
||||
'((C K)
|
||||
(char (+ 65 (% (+ 26 (- C K)) 26))) )
|
||||
(vigenereKey Str)
|
||||
(apply circ (vigenereKey Key)) ) ) )
|
||||
Loading…
Add table
Add a link
Reference in a new issue