This FileHandler makes some assumptions:
Checksums are stored in a file of their own, with the extension of
that file determining the type of the checksum. E.g. the extension
.md5 will select the MD5 algorithm, while
.crc chooses CRC and
The checksum file stores the checksum in hexadecimal format on the first line. All subsequent content after that first line is ignored.
The base name of the checksum file matches the file over which the checksum should be calculated.
download.zip.md5contains an MD5 checksum for the contents of the file
Opening the checksum file in this FileHandler will load the checksum and display it in the form most common for the chosen algorithm. The name of the target file is also displayed along with the algorithm name of the checksum derived from the extension.
Verification can now be started by pressing the corresponding button. This will then re-compute the checksum over the target files contents and display the result along with a message which helps interpretation.
Verification is disabled if the target file cannot be found. The target file must be located in the same directory as the checksum file itself.
Depending on the size of the target file and the chosen algorithm, verification can take a long time. A status message indicates the running computation but currently no support for aborting is present.
In case the calculation resulted in a different checksum than the one that was loaded, saving will be enabled if allowed by the configuration.
Loading the checksum from the file is very fault tolerant in the sense that just the required number of hexadecimal characters are read from the first line. In case the file contains invalid or not enough contents, this will simply result in an invalid checksum. Thus it is easy to create a new checksum file by simply taking any (even an empty) file as a template an then perform the initial computation of the checksum.