You are not logged in.
in web client, use below link crc32 function in
http://synopse.info/forum/viewtopic.php?pid=9485#p9485
computer such string:
ShipAgent/ShipSpecification?select=*&where=Name like :('%海洋皇后%'): OR ChineseName LIKE :('%海洋皇后%'):
function(str, init)
init is 1725494238,
the result is 450260155
but in delphi test:
procedure TForm5.Button2Click(Sender: TObject);
var
url: RawUTF8;
fPrivateSaltHash: Cardinal;
aTimeStamp, aSignature, fLastTimeStamp: cardinal;
PTimeStamp: PAnsiChar;
aURLlength: Integer;
URISessionSignaturePos: integer;
s: RawUtf8;
c,c2: Cardinal;
begin
url := 'ShipAgent/ShipSpecification?select=*&where=Name like :(''%海洋皇后%''): OR ChineseName LIKE :(''%海洋皇后%''):&session_signature=0051C0FA00D9AABE1AD66CBB';
URISessionSignaturePos := length(url)-(17+24+1);
aURLlength := URISessionSignaturePos - 1;
PTimeStamp := @url[aURLLength+(20+8)]; // P^ points to Hexa8(TimeStamp)
fPrivateSaltHash := 407090865;
fLastTimeStamp := 14264847;
if not HexDisplayToCardinal(PTimeStamp,aTimeStamp) then s := s + 'Error1,';
if not (aTimeStamp>=fLastTimeStamp) then s := s + 'Error2,';
if not HexDisplayToCardinal(PTimeStamp+8,aSignature) then s := s + 'Error3,';
// if not (crc32(crc32(fPrivateSaltHash,PTimeStamp,8),pointer(url),aURLlength)=aSignature) then s := s + 'Error4,';
c := crc32(fPrivateSaltHash,PTimeStamp,8);
c2 := crc32(c,pointer(url),aURLlength);
if not (crc32(c,pointer(url),aURLlength)=aSignature) then s := s + 'Error4,';
showmessage(inttostr(c2));
end;
the result is 1201321865,
this will cause TAuthSession.IsValidURL return false, then the web client will not pass Auth,
if no chinese word, then two crc32 result is same, which result is right, any help much appreciated, thanks!
Offline
Update, Problem resoved, the javscript crc32 function work on ascii char, so before computer the crc32 value, need first utf8 encode the string, then computer result will same, thanks!
Offline
Yes, crc32() is a byte-oriented function, not string-oriented.
Internally, the framework core works with UTF-8 text encoding everywhere (mainly RawUTF8 or memory buffers), not UnicodeString.
Offline