Post
#1
|
|
|
Grupa: Zarejestrowani Postów: 32 Pomógł: 0 Dołączył: 13.07.2009 Skąd: Ziemia Ostrzeżenie: (0%)
|
Witam, czy ktos moze mi pomoc przekonwertowac kod z delphi na php? jest to funkcja do szyfrowania danych. Oto kod:
Kod function StrToStrHash(Str, Key: String): String;
var i: Integer; begin Result := ''; for i := 1 to length(Key) do Result := Result + IntToBaseX(StrToHash(Str, i * ord(Key[i])), 62); end;{StrToStrHash} function StrToHash(Str: String; Method: Cardinal): Cardinal; const Pow: array[0..7] of Integer = (1, 2, 4, 8, 16, 32, 64, 128); var i, j, ByteVal: Integer; TestBit: Boolean; begin Result := 0; for i := 1 to length(Str) do begin ByteVal := ord(Str[i]); for j := 7 downto 0 do begin TestBit := ((Result and 32768) = 32768) xor ((ByteVal and Pow[j]) = Pow[j]); Result := ((Result and 32767) * 2); if TestBit then Result := Result xor Method; end;{for j} end;{for i} end;{StrToHash} |
|
|
|
kenobi13 [PHP] Konwersja kodu z delphi do php 18.04.2010, 19:41:38
jareeny pomóc? to pokaż co już sam zaczęłeś jeżeli nic, t... 19.04.2010, 05:33:37
kenobi13 Mam prawie całe StrToStrHash przerobione. A za Str... 19.04.2010, 13:30:44
phpion Cytat(kenobi13 @ 19.04.2010, 14:30:44... 19.04.2010, 13:35:48 ![]() ![]() |
|
Aktualny czas: 24.12.2025 - 09:59 |