Calculate File Checksum

Generates a hash (checksum) value for a file and places it into the specified variable. While CRC is the default algorithm, this action also supports MD5 and several SHA variants (in order from quickest but least efficient to slowest but most efficient). Commonly used to validate the integrity of data by calculating a checksum using the selected algorithm. The result is placed in a variable, which can be stored for later validation of the file or compared with an earlier checksum to verify the file's integrity.

Declaration

<AMCALCHASH FILE="Text" HASHTYPE="Text" RESULTVARIABLE="Text" />

Example

Calculate the checksum of file "C:\FolderName\FileName.doc" using the "MD5" algorithm and store the result in variable "VariableName".

<AMCALCHASH FILE="C:\FolderName\FileName.doc" HASHTYPE="MD5" RESULTVARIABLE="VariableName" />

See Also: Split File, Move File, Create Folder, Delete File, Delete Folder, Rename Folder, Remove Folder, Touch File, Set Attributes, Read from File, Write to File, Synchronize Folders, Concatenate Files

General Tab

Property

Type

Required

Default

Markup

Description

File

Text

Yes

(Empty)

FILE="c:\folder\file.txt"

Specifies the path and file name of the file to check.

Algorithm

Text

(Options)

No

CRC

HASHTYPE="MD5"

Indicates the algorithm to use during calculation. The available options are:

  • CRC (default): Cyclical Redundancy Checking. Fastest and least secure.

  • MD5: Message Digest 5. Slower and more secure than CRC.

  • SHA1: Secure Hash Algorithm-1. Slower and more secure than MD5.

  • SHA256: Secure Hash Algorithm-256. Slower and more secure than SHA1.

  • SHA384: Secure Hash Algorithm-384. Slower and more secure than SHA256.

  • SHA512: Secure Hash Algorithm-512. Slowest and most secure.

Populate Variable with the Checksum

Text

No

(Empty)

RESULTVARIABLE="VarName"

Specifies the name of an existing variable in which to populate with the checksum result. The variable must be created in a previous step using the Create Variable action.