Source
Edit
Nim OID support. An OID is a global ID that consists of a timestamp, a unique counter and a random value. This combination should suffice to produce a globally distributed unique ID.
This implementation calls initRand() for the first call of genOid.
proc `==`(oid1: Oid; oid2: Oid): bool {.inline, ...raises: [], tags: [],
forbids: [].}
-
Compares two OIDs for equality.
Source
Edit
proc genOid(): Oid {....raises: [], tags: [TimeEffect], forbids: [].}
-
Generates a new OID.
Example:
doAssert ($genOid()).len == 24
Example: cmd: -r:off
echo $genOid()
Source
Edit
proc hash(oid: Oid): Hash {....raises: [], tags: [], forbids: [].}
-
Generates the hash of an OID for use in hashtables.
Source
Edit