We use this function to generate GUID's and assign to records:
var genguid = function b(a) {
return a ? (a ^ Math.random() * 16 >> a / 4).toString(16) : ([1e6] + '').replace(/[018]/g, b)
}
The issue is, we're starting to get duplicates, from multiple devices.
The random part could use a salt, possible from the current time or location (since these are used on mobile devices).
Any suggestions on what function / method to use to obtain that?
UPDATE: The code runs on a mobile app which uses JS. I just ran the old code on 1 trillion GUID's and there were no duplicates. So i'm guessing it's something with the JS implementation on the mobile client?