New function: $guid() - for creating a totally unique random ID each operation


There are a number of ways to produce an almost-unique identifier for a file: a hash, timestamp, or a combination of values, etc.

However none of these solutions are perfect, as there can be still be collisions with files sharing the same combination of tags, audio, or timestamp. The Md5 hashing function is useful for outputting a unique value of a file, yet it's use is limited for creating a unique non-changing identifier of a file, also the function isn't available in the Actions.

A GUID function would be an ideal solution for creating a completely random series of characters that could be used for identifying an item, regardless of it's contents, as GUIDs contain enough length and entropy (complexity) to never have a collision.

There have been a number of people who have desired to have the ability to create a unique ID per file, or per cover art, via a script function, and in particular DetlevD has been a frequent advocate of such a function.

The function could work as so:

Input: $guid()

Output (random each time): {C200E360-38C5-11CE-AE62-08002B2B79EF}

Relevant posts:

[Link] Outline of how the function could be implemented from the existing system function into Mp3Tag, and how the output could be formatted.

I believe such a function would be a useful asset and could complement Mp3Tag's existing scripting functionality. Hopefully this function could be considered for the next development version of Mp3Tag.

Extract weekdays and month names from timestamp