Search code examples
hashgoogle-docsgoogle-data-apigoogle-docs-api

Getting hashes of Google Docs documents?


Although Google Docs documents seem to have a unique ID in the URL, I'm wondering if there is a way to get a hash (MD5, SHA1) of a document without downloading it again. Has anyone attempted something similar? Is there some API call I can make?


Solution

  • For files stored on Google Docs, an md5 checksum is provided in the document list entry:

    <!-- Given for files only. An MD5 checksum used to verify the contents of this file. -->
    <!-- Some old files are being processed. Those files will not have this element yet. -->
    <docs:md5Checksum>2b01142f7481c7b056c4b410d28f33cf</docs:md5Checksum>
    

    For Google Docs document, you can use the "Etag" element to check for changes.