Skip to content
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

Don't use md5 to calculate objectid #88

Open
daviddavis opened this issue Jun 4, 2018 · 1 comment
Open

Don't use md5 to calculate objectid #88

daviddavis opened this issue Jun 4, 2018 · 1 comment

Comments

@daviddavis
Copy link
Contributor

md5 has a lot of limitations. See this commit in pymongo on a possible replacement:

mongodb/mongo-python-driver@6185035

gabrielperes97 added a commit to gabrielperes97/bson that referenced this issue Oct 10, 2018
Parkayun added a commit that referenced this issue Oct 30, 2018
Use FNV-1a for ObjectId machine bytes - Issue #88
@amcgregor
Copy link

amcgregor commented Mar 26, 2019

The sheer volume of reduction happening means that choice of hash is essentially irrelevant, though I'm pleased to see choice of a hash that actually fits as a proposal. Collisions will occur. Because this isn't being used as a data integrity mechanism, this is (for the most part) perfectly acceptable. It's just a pseudo-distinct hardware identifier. [Edited to add:] it's sufficiently distinct when combined with hardware management logs, e.g. a duplicate HWID would likely not happen simultaneously.

The ultimate approach to making this component distinct would be to give the developer control over it. E.g. allow them to explicitly identify the "current machine" for their own internal management. (Unfortunately, my own actual hardware IDs are 128-bit UUIDs…)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants