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

Viewed 2677

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.

2 Answers

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

Related