Options
All
  • Public
  • Public/Protected
  • All
Menu

@thi.ng/idgen

Index

Classes

Variables

Functions

Variables

Const EVENT_ADDED

EVENT_ADDED: "added" = "added"

Const EVENT_REMOVED

EVENT_REMOVED: "removed" = "removed"

Functions

Const idgen

  • idgen(bits: number, vbits?: number, cap?: number, start?: number): IDGen
  • Returns a new IDGen instance configured to use given counter & version bits.

    remarks

    Overall ID range/capacity can be explicitly limited using cap (default and maximum: 2^bits). The start ID can be defined via start (default: 0) and MUST be < cap.

    Parameters

    • bits: number
    • Optional vbits: number
    • Optional cap: number
    • Optional start: number

    Returns IDGen

Generated using TypeDoc