What is format of Google Drive's FileID ? I need to find out whether new File has been uploaded to my drive or not using API's

风格不统一 提交于 2021-02-07 09:01:04

问题


If FileID follows a particular format like new file has higher values or lower values I can keep track of the old values and find out whether I hace uploaded a new File in drive.


回答1:


File ID is just a random string - there is no format.

You are taking the wrong approach. Look at the changes resource https://developers.google.com/drive/v3/reference/changes




回答2:


The format is a 264 bit number

bit 0   5 6             261 261 263
+--------+-----------------+-------+
| 110101 | 256 RANDOM BITS | 00    |
+--------+-----------------+-------+

url safe base64 encoded as

/1[a-zA-Z0-9_-]{42}[AEIMQUYcgkosw048]/

You can store just the random part as a Byte[32] but it is safer to treat it as a random string as this may change at any time



来源:https://stackoverflow.com/questions/47151920/what-is-format-of-google-drives-fileid-i-need-to-find-out-whether-new-file-ha

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!