Hashing entirely in memory (Delphi example)
In This Topic
Delphi |
Copy Code |
uses XceedEncryptionLib_TLB
var xHash : TXceedHashing; xSHA : DXceedSHAHashingMethod; vaSource : OleVariant; vaHashValue : OleVariant; begin xHash := TXceedHashing.Create( self ); xHash.License( 'your license key' );
xSHA := CoXceedSHAHashingMethod.Create();
try xSHA.HashSize := 256; xHash.HashingMethod := xSHA;
vaSource := 'This is the data to hash';
xHash.Hash( vaSource, true );
vaHashValue := xSHA.HashValue;
{ Do something with the HashValue... }
ShowMessage( 'Hashing successful!' ); except on xErr : Exception do ShowMessage( xErr.Message ); end;
xHash.Free; end; |