Document Integrity Checksum

Hi,

Does anyone know of a way to calculate a checksum for an entire document, which could then be checked onload in order to verify the document integrity?

I’ve done this quite some time on various fields, but never on a whole doc.

Any help would be appreciated