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
I'm working on cordova based application and want to generate ObjectId in browser. From source code I see that MACHINE_ID is a random number and it means that I potentially may have issues when 2 clients of my application generate the same ObjectId.
In order to overcome this issue I could use cordova-plugin-device, retrieve uuid and use it as MACHINE_ID. That way I will make sure that all my clients generate unique ObjectIds.
Alternatevely it's possible to use userId as MACHINE_ID which is provided by my API.
timestamp+machineid+programid+counter produces an amazing amount of entropy so collisions would be pretty phenomenal.
... but, if folks want to specify a machine id- sure they can use it at their own risk! setMachineId will just need to validate that the input is an int. Just know that it will truncate that int to the last 6 hex chars. (That mirrors how the bson lib works)
In browser MACHINE_ID will be regenerated each time user open/close application, that's why I want to ensure that it's a static unique number for this user which doesn't change
I'm working on cordova based application and want to generate
ObjectId
in browser. From source code I see thatMACHINE_ID
is a random number and it means that I potentially may have issues when 2 clients of my application generate the sameObjectId
.In order to overcome this issue I could use
cordova-plugin-device
, retrieve uuid and use it asMACHINE_ID
. That way I will make sure that all my clients generate uniqueObjectId
s.Alternatevely it's possible to use
userId
asMACHINE_ID
which is provided by my API.I can create a PR if you are ok with suggestion:
The text was updated successfully, but these errors were encountered: