ImageEn, unit hyieutils

TIEHashStream


Declaration

TIEHashStream = class(TStream)


Description

Builds a hash string from a stream using a standard algorithm: MD2, MD4, MD5, SHA1, SHA2, SHA384 or SHA512.


Examples

// Save image with a unique name (by creating a hash from the jpeg content and using it as the filename)
var
  hashStream: TIEHashStream;
begin
  hashStream := TIEHashStream.Create(iehaMD5);
  try
    ImageEnView1.IO.SaveToStreamJpeg(hashStream);
    hashStream.SaveToFile(hashStream.GetHash()+'.jpg');
  finally
    hashStream.Free;
  end;
end;


Methods and Properties

Public Method  Create
Public Method  GetHash
Public Method  LoadFromFile
Public Method  LoadFromStream
Public Method  Write
Public Method  Read
Public Method  Seek
Public Method  SaveToFile
Public Method  SaveToStream