problem with TIdHashMessageDigest5 on latest snapshot

Giganews Newsgroups
Subject: problem with TIdHashMessageDigest5 on latest snapshot
Posted by:  Pibì
Date: Mon, 18 Dec 2006

Hi!

Upgrading from 10.1.5 (included in BDS 2006) to latest snapshot 10.1.6
(17/12/2006) this code generate a different output:

OLD CODE:

function HashPwd(const pwd : string): string;
var
  hashObj : TIdHashMessageDigest5;
begin
  hashObj:=TIdHashMessageDigest5.Create;
  result:=TIdHashMessageDigest5.AsHex(hashObj.HashValue('SecretSeed'+pwd));
  hashObj.Free;
end;

NEW CODE (converted to latest snapshot):

function HashPwd(const pwd : string): string;
var
  hashObj : TIdHashMessageDigest5;
begin
  hashObj:=TIdHashMessageDigest5.Create;
  result:=hashObj.HashStringAsHex('SecretSeed'+pwd);
  hashObj.Free;
end;

Something is wrong in my code?

ciao  Paolo

Replies