Need Checksum of a file on Onedrive/Sharepoint cloud

I need to check integrity of a file that I have uploaded using Microsoft Graph onto Onedrive/Sharepoint. Is there some checksum available via Microsoft Graph ?

Regards Allan


This information can be found in the driveItem resource. You request the file with drive/items/{item-id} and the returning JSON will have a 'file' part looking like this:

"file": {
    "hashes":{
      "sha1Hash":"wmgPQ6jrSeMX7JP1XmstQEGM2fc="
    }
  }

The hash type is usually either SHA1 or SHA256.

A good starting point on how to retreive this information, is via the official documentation on working with files in Microsoft Graph