-
Notifications
You must be signed in to change notification settings - Fork 1
/
str-obf.nix
63 lines (63 loc) · 852 Bytes
/
str-obf.nix
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
lib:
let
encodeTable = {
a = "h";
b = "g";
c = "z";
d = "m";
e = "l";
f = "j";
g = "v";
h = "a";
i = "n";
j = "t";
k = "w";
l = "b";
m = "y";
n = "x";
o = "i";
p = "q";
q = "o";
r = "f";
s = "d";
t = "s";
u = "r";
v = "e";
w = "k";
x = "c";
y = "p";
z = "u";
};
decodeTable = {
h = "a";
g = "b";
z = "c";
m = "d";
l = "e";
j = "f";
v = "g";
a = "h";
n = "i";
t = "j";
w = "k";
b = "l";
y = "m";
x = "n";
i = "o";
q = "p";
o = "q";
f = "r";
d = "s";
s = "t";
r = "u";
e = "v";
k = "w";
c = "x";
p = "y";
u = "z";
};
in
{
encode = lib.stringAsChars (x: encodeTable.${x} or x);
decode = lib.stringAsChars (x: decodeTable.${x} or x);
}