-
Notifications
You must be signed in to change notification settings - Fork 0
/
atbash.ahk
38 lines (34 loc) · 1.01 KB
/
atbash.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
; ====================================================
; ============== AHK Atbash Encoder GUI ==============
; ====================================================
; AutoHotKey version: 1.1.35.0
; Language: English
; Author: Pedro F. Albanese
; Modified: -
;
; ----------------------------------------------------------------------------
; Script Start
; ----------------------------------------------------------------------------
#NoEnv
SetBatchLines, -1
Gui, Margin, 20, 10
Gui, Font, s10, Courier New
Gui, Add, Edit, w600 r10 vInput
Gui, Font
Gui, Add, Button, gEncode, Encode
Gui, Font, s10, Courier New
Gui, Add, Edit, xm w600 r10 vResult +ReadOnly
Gui, Show, , AHK Atbash
Return
GuiClose:
ExitApp
Encode:
Gui, Submit, NoHide
GuiControl, , Result, % Atbash(Input)
Return
Atbash(str) {
For i, v in StrSplit(str) {
nStr .= RegExMatch(v, "[A-Z]") ? Chr(90 - Mod(Asc(v) + 13,26)) : RegExMatch(v, "[a-z]") ? Chr(122 - Mod(Asc(v) + 7, 26)) : v
}
return nStr
}