Create a file

Each Markdown file you create will be stored inside a new versioned structured data. In order for you to be able to retrieve your files, the app needs to add the filename of each file you create to your file index.

Contents

Create file

The app creates a versioned structured data (type tag 501) with an ID based on your user prefix and the filename. This structured data will contain all the different versions of your file. The first version is encrypted using the cipher options handle previously obtained.

safeStructuredData.create(ACCESS_TOKEN,// trying to come up with a name that is super unlikely to clash ever.btoa(`${USER_PREFIX}:${filename}`),// 501 => we want this versioned501, payload, SYMETRIC_CYPHER_HANDLE)

Each version includes the Markdown content and the current time (encoded as a base 64 string).