How to verify exact file recovery with SHA-256
A recovered file may appear correct while differing from the original at the byte level.
Recovery procedure
On Windows use Get-FileHash -Algorithm SHA256 with the file path; on macOS use shasum -a 256 with the file path. Compare with a digest recorded before the damage or independently established from the correct original version. Do not compare against a newly generated digest of the damaged input and call it proof of restoration.
How to verify the result
Report the two digest values and reference version. A visually identical resave can have a different digest; that is not byte-exact recovery.
Technical decision example
Illustrative distinction: two PSDs can render identically while one has different layer names or metadata. Their file digests will normally differ. Use a native application comparison to assess editable equivalence and a trusted digest comparison to assess binary equivalence. These answer different questions.
Recovery limits
A new hash of the damaged file cannot establish what the original hash was.
Measured hash verification test
In a controlled test of FileRevivo’s bundled SHA-256 implementation, eight byte sequences, including an empty input and a 4,194,305-byte input crossing the internal 4 MiB read boundary, matched Node.js crypto’s independent SHA-256 result. This validates these hash cases only. To certify a recovery, compare the output digest with a trusted digest of the original version, not just the damaged input.