Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2002.10.28;
Скачать: CL | DM;

Вниз

Crypt   Найти похожие ветки 

 
LYNXic ©   (2002-10-16 15:08) [0]

Почему этот код шифрует не весь текст, а только примерно 70-80 символов

unit Crypt32;

interface

const
StartKey = 981;
MultKey = 12674;
AddKey = 35891;

function Encrypt(const InString:string; StartKey,MultKey,AddKey:Integer): string;

implementation

{$R-}
{$Q-}

function Encrypt(const InString:string; StartKey,MultKey,AddKey:Integer): string;
var
I : Byte;
begin
Result := "";
for I := 1 to Length(InString) do
begin
Result := Result + CHAR(Byte(InString[I]) xor (StartKey shr 8));
StartKey := (Byte(Result[I]) + StartKey) * MultKey + AddKey;
end;
end;
{$R+}
{$Q+}

end.


 
McSimm ©   (2002-10-16 15:12) [1]

Этот код был написан для строк длиной < 256 символов.
Замени в обоих функциях

I : Byte;
на
I : Integer;
Все заработает.



Страницы: 1 вся ветка

Текущий архив: 2002.10.28;
Скачать: CL | DM;

Наверх




Память: 0.46 MB
Время: 0.012 c
1-92592
jen_bond
2002-10-17 08:52
2002.10.28
MainMenu 2000/Xp


4-92801
@andrew
2002-09-16 18:21
2002.10.28
ShellExecute


14-92679
alf_
2002-09-28 16:54
2002.10.28
ответы на мои вопросики


14-92688
Hooch
2002-10-07 14:16
2002.10.28
Лекции в вузе


3-92400
race1
2002-10-08 16:59
2002.10.28
ib