done in Delphi finally HexStr := 'A10000009296F2';
BinaryStream := TMemoryStream.Create;
try
BinaryStream.Size := Length(HexStr) div 2;
if BinaryStream.Size > 0 then
begin
HexToBin(PAnsiChar(HexStr), BinaryStream.Memory, BinaryStream.Size);
// read into the buffer
j2 := BinaryStream.Read(buffer,Sizeof(buffer));
x := TDCP_sha1.Create(nil);
x.Init;
x.Update(buffer,j2);
SetLength(HashDigest, x.GetHashSize div 8);
x.Final(HashDigest[0]);
for j := 0 to Length(HashDigest) - 1 do // convert it into a hex string
s := s + IntToHex(HashDigest[j],2);
end;
finally
x.Free;
BinaryStream.Free;
end;
trim(s);
msg(s,clyellow);
this is outut tmemo1
2D0E6EFEA8F8082C9703CF6636C4A2195C75B7ED
thanks stanner_austin Ni****h |