Sample code for 30+ languages & platforms
Delphi DLL

Compute Glacier SHA256 Linear Hash of a File

See more Amazon Glacier Examples

Computes the Amazon Glacier SHA256 linear hash for a file.

Chilkat Delphi DLL Downloads

Delphi DLL
uses
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
    Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Crypt2;

...

procedure TForm1.Button1Click(Sender: TObject);
var
crypt: HCkCrypt2;
linearHashHex: PWideChar;

begin
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

crypt := CkCrypt2_Create();

// The "linear hash" is simply the SHA256 hash of the file bytes.
CkCrypt2_putHashAlgorithm(crypt,'sha256');

// Return the hash in lowercase hexidecimal format.
CkCrypt2_putEncodingMode(crypt,'hexlower');

linearHashHex := CkCrypt2__hashFileENC(crypt,'qa_data/jpg/penguins.jpg');
Memo1.Lines.Add('SHA256 linear hash = ' + linearHashHex);

CkCrypt2_Dispose(crypt);

end;