📄 加密解密函数.txt
字号:
function passformat(pws:String; isRead:Boolean):String;
var
temp_pws:String[30];
pws_length,
i:ShortInt;
begin
randomize; //初始化随机数产生器
pws_length := 0;
if isRead then
begin
case pws[5] of
'1'..'9' : pws_length := Integer(pws[5])-48;
'a' : pws_length := 10;
'b' : pws_length := 11;
'c' : pws_length := 12;
'd' : pws_length := 13;
'e' : pws_length := 14;
'f' : pws_length := 15;
'g' : pws_length := 16;
end;
temp_pws := Copy(pws, 6, pws_length); //===========
for i:=1 to pws_length do
begin
temp_pws[i] := Char(Integer(temp_pws[i]) - 5);
end;
end
else
begin
pws_length := length(pws);
case pws_length of
1..9 : temp_pws[5] := chr(48 + pws_length);
10 : temp_pws[5] := 'a';
11 : temp_pws[5] := 'b';
12 : temp_pws[5] := 'c';
13 : temp_pws[5] := 'd';
14 : temp_pws[5] := 'e';
15 : temp_pws[5] := 'f';
16 : temp_pws[5] := 'g';
end;
for i := 1 to 4 do
begin
temp_pws[i] := chr(48 + Random(10));
end;
for i := 6 to 6 + pws_length - 1 do //=========
begin
temp_pws[i] := Char(Integer(pws[i - 5]) + 5); //=======
end;
for i := pws_length + 6 to 30 do //===========
begin
temp_pws[i] := chr(97 + Random(26));
end;
end;
temp_pws := copy(temp_pws,1,30); //返回长度为30位的串
Result := temp_pws;
end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -