computeChecksum
Computes an SHA-256 digest that represents the current state of file.
For a regular file, the digest covers its content.
For a directory, the digest covers the sorted list of relative paths and file sizes, which is fast (metadata only) and catches additions, deletions, and size changes.