# oids

- マニュアル
- 標準ライブラリ
- 索引

検索
分類:

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 was extracted from the Mongodb interface and it thus binary compatible with a Mongo OID.

This implementation calls `math.randomize()` for the first call of `genOid`.

# インポート

hashes, times, endians

# 型

    Oid = object
      time: int32
      fuzz: int32
      count: int32

  an OID Source Edit

# プロシージャ

    proc `==`(oid1: Oid; oid2: Oid): bool {...}{.raises: [], tags: [].}

  Compare two Mongo Object IDs for equality Source Edit

    proc hash(oid: Oid): Hash {...}{.raises: [], tags: [].}

  Generate hash of Oid for use in hashtables Source Edit

    proc hexbyte(hex: char): int {...}{.raises: [], tags: [].}

  ソース 編集

    proc parseOid(str: cstring): Oid {...}{.raises: [], tags: [].}

  parses an OID. ソース 編集

    proc oidToString(oid: Oid; str: cstring) {...}{.raises: [], tags: [].}

  ソース 編集

    proc `$`(oid: Oid): string {...}{.raises: [], tags: [].}

  ソース 編集

    proc genOid(): Oid {...}{.raises: [], tags: [TimeEffect].}

  generates a new OID. ソース 編集

    proc generatedTime(oid: Oid): Time {...}{.raises: [], tags: [].}

  returns the generated timestamp of the OID. ソース 編集