Delphi DLL Requires Chilkat v11.6.0+
Delphi DLL
Compute Glacier SHA-256 Linear Hash
See more Amazon Glacier Examples
For existing Amazon Glacier vault customers. The standalone vault service is closed to new customers. These examples use its REST API version 2012-06-01, not the S3 bucket APIs used by S3 Glacier storage classes. See AWS service guidance.
Computes ordinary SHA-256 over the exact file bytes, used as the SigV4 payload hash. This differs from the Glacier tree hash for files larger than 1 MiB. Keep the file unchanged between hashing and uploading.
Chilkat Delphi DLL Downloads
var
crypt: HCkCrypt2;
hashHex: PWideChar;
begin
// Assumes Chilkat is unlocked. See Global Unlock Sample.
crypt := CkCrypt2_Create();
CkCrypt2_putHashAlgorithm(crypt,'sha256');
CkCrypt2_putEncodingMode(crypt,'hexlower');
hashHex := CkCrypt2__hashFileENC(crypt,'qa_data/jpg/penguins.jpg');
if (CkCrypt2_getLastMethodSuccess(crypt) <> True) then
begin
Memo1.Lines.Add('Hashing failed; check that the file exists and is readable.');
Exit;
end;
Memo1.Lines.Add(hashHex);
CkCrypt2_Dispose(crypt);