Max Nikulin <maniku...@gmail.com> writes: > On 23/07/2022 12:22, Ihor Radchenko wrote: >> Tentative patch is attached. > >> + (if (< (length id) 3) >> + (org-attach-id-uuid-folder-format (md5 id)) > > Ihor, I am afraid of collisions due to short input to md5. Long hash > value gives false impression of high entropy but actually there are not > so many variants for 1 or 2 characters strings. Either there is no point > in making long name from short id or random string of appropriate length > should be used instead.
Random is not an option. If we use random string, how will we get the right attachment path on a second call? This function must return the same value given the same input. Having said that, I do agree (taking into account the other comment) that md5 may not be a very good idea. Maybe simply something like "__/id". Ideally, we should be able to recover the original id from the path to attachment. Best, Ihor