lib/data_integrity_utils.pm

data_integrity_utils

Library to verify image data integrity by comparing SHA256 and SHA512 checksums

get_image_digest

get_image_digest($image_path);

Returns image digest. Image path $image_path is the parameter which is used to get image digest. Digest retrieval is platform-specific depends.

verify_checksum

verify_checksum($dir_path);

Verify image data integrity by comparing checksums. Tries SHA-256 first; falls back to SHA-512 only if SHA-256 doesn't match. Supports full SHA-512 (128 chars) and truncated SHA-512 (first 64 chars) checksums. Directory path $dir_path is the parameter which is a part of image path '$image_path' if exists.

Returns error message in case of failure, empty string in case of success.