View Single Post
Old 10-03-2017, 01:20   #7 (permalink)
doctorsu
Insane Poster
 
Join Date: Jan 2017
Posts: 95
Member: 2674769
Status: Offline
Thanks Meter: 17
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
  Reply With Quote
The Following User Says Thank You to doctorsu For This Useful Post:
 
Page generated in 0.06353 seconds with 7 queries