Skip to content

ObjectId generation uses outdated specification #2

@alcaeus

Description

@alcaeus

I noticed that the ObjectId generation uses a machine ID and process ID to generate bytes 4-8. This was replaced with a 5-byte random value that is generated once per process back in 2018 as per the ObjectId Specification. Changing this will also speed up generation of new ObjectIds, as the value can be initialised once per process in a static property, instead of the current logic that runs pack, substr, md5, and gethostname.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions