Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
oids counter starts at zero; spec says it should be random #2796
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 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.
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
added a commit
Jan 30, 2019
that's tracked here: genOid has low entropy (creates lots of 0 bits) · Issue #9741 · nim-lang/Nim