-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
oids counter starts at zero; spec says it should be random #2796
Comments
If your proposed fix uses |
That would only be true if the counter were re-randomized each time the clock changed, and even then not so much. |
What's the status of this? |
The linked documentation reads
but the implementation in type
Oid* = object ## an OID
time: int32 ##
fuzz: int32 ##
count: int32 ## where fuzz is random but fixed. This does not seem to be too compatible. Either
|
I propose that we just remove from the documentation any link with mongodb, since the implementation is not compatible, but unique ids are useful anyway (notice that there is an external library for actual uuids though). Mongo drivers can implement oids that are actually compatible with the spec |
The module was written for Mongodb though and I ported the C code from it (it looks like Mongo later changed its implementation). No idea why we can't simply fix this and call it a day. |
that's tracked here: genOid has low entropy (creates lots of 0 bits) · Issue #9741 · nim-lang/Nim |
http://docs.mongodb.org/manual/reference/object-id/ says that the 'counter' field of an object ID should start at a random value. In oids.nim, it starts at 0.
I have a patch for this, and I'm using this issue to get approval from my workplace to commit to Nim.
The text was updated successfully, but these errors were encountered: