MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / oid_generated_on_process

Function oid_generated_on_process

test/utils_shared.py:372–376  ·  view source on GitHub ↗

Makes a determination as to whether the given ObjectId was generated by the current process, based on the 5-byte random number in the ObjectId.

(oid)

Source from the content-addressed store, hash-verified

370
371
372def oid_generated_on_process(oid):
373 """Makes a determination as to whether the given ObjectId was generated
374 by the current process, based on the 5-byte random number in the ObjectId.
375 """
376 return ObjectId._random() == oid.binary[4:9]
377
378
379def delay(sec):

Callers 1

test_random_bytesMethod · 0.90

Calls 1

_randomMethod · 0.80

Tested by 1

test_random_bytesMethod · 0.72