def modpow(b, e, m):
result = 1
while (e > 0):
if e & 1:
result = (result * b) % m
e = e >> 1
b = (b * b) % m
return resul
----------------------------------------------------------------------------------------------
def str_to_int(string):
str_int = 0
for i in range(len(string)):
str_int = str_int <<
str_int += ord(string[i]
return str_int
这个两段怎么转Delphi !!
以下是我自己转的第二段,不行,,,,求助
function str_to_int(SK: string): Integer;
var
I: Integer;
str_int: Integer;
begin
str_int := 0;
for i := 1 to Length(SK) do
begi
str_int := str_int shl 8;
str_int := str_int + ord(SK[i]);
end
Result := str_int;
end;