GUID globally-unique identifiers

Hello,
there is the possibility to generate a GUID ?
I’m not sure if noise generator can help me,but I understand that I’m not able to use it :frowning:
1 question: what is the noise generatore and how can I use it (I wrote the documentation but I didn’t understand)
2 - if not, there is an other GD function ?
3 - if not, can you please suggest me a Javascript command (so I’ll write the function) ?

Thanks,
J

If you want to generate your own you can create an Extenstion and then add this block as a String Expression:

function uuidv4() {
  return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c =>
    (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
  );
}

eventsFunctionContext.returnValue = uuidv4();

If you want to use the internal UUID associated with your project you can create a String Expression like above but with the following javascript:

eventsFunctionContext.returnValue = gdjs.projectData.properties.projectUuid;

I don’t think that UUID is documented anywhere, so it’s probably subject to change. It’s probably what GDevelop uses to track analytics.

Indeed, there is no name or personnal data, just a UUID for each project used for analytics.
The gdjs documentation have to be rethink and complete it is a huge task :exploding_head:

WOW, thanks.
I have insert it in my very very simple JavaScript Tool Extension: