Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rot(C, B, N) ->
- (C - B + N) rem 26 + B.
- encrypt([], _) -> [];
- encrypt([C | S], N) ->
- Nc = if
- ($A =< C) andalso ($Z >= C) ->
- rot(C, $A, N);
- ($a =< C) andalso ($z >= C) ->
- rot(C, $a, N);
- true ->
- C
- end,
- [Nc | encrypt(S, N)].
- decrypt(String, N) ->
- encrypt(String, 26-N).
- test_version() -> 1.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement