You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Returns a string that's usable as an object id.
// Probably unique. Good enough? Probably!
function newObjectId() {
var chars = ('ABCDEFGHIJKLMNOPQRSTUVWXYZ' +
'abcdefghijklmnopqrstuvwxyz' +
'0123456789');
var objectId = '';
for (var i = 0; i < 10; ++i) {
objectId += chars[Math.floor(Math.random() * chars.length)];
}
return objectId;
}
How are we supposed to use that without certainity that it will always create unique objectId???
The text was updated successfully, but these errors were encountered:
There's a PR to enhance the entropy using better random bytes, which we'll likely accept, but honestly this is not that bad (something like 1 in 900 million). Will be resolved with #73.
How are we supposed to use that without certainity that it will always create unique objectId???
The text was updated successfully, but these errors were encountered: