Главная страница
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.013 c
1-92462
Le!
2002-10-18 08:06
2002.10.28
Сдвиг обьектов при запуске программы на другом компе!


3-92394
PeteDm
2002-10-01 20:57
2002.10.28
MSSQL


1-92450
Dasha
2002-10-18 05:17
2002.10.28
RX-Library


3-92388
Dimedrol
2002-10-03 18:17
2002.10.28
Query.Locate не работает...


14-92704
bassa
2002-10-08 14:30
2002.10.28
IBM