# yitter/IdGenerator

💎多语言实现，高性能生成唯一数字ID。 💎优化的雪花算法（SnowFlake）——雪花漂移算法，在缩短ID长度的同时，具备极高瞬时并发处理能力（50W/0.1s）。 💎原生支持 C#/Java/Go/Rust/C/JavaScript/TypeScript/Python/Pascal 多语言，提供其它适用于其它语言的多线程安全调用动态库（FFI）。💎支持容器环境自动扩容（自动注册 WorkerId ），单机或分布式唯一IdGenerator。💎顶尖优化，超强效能。

Repository: https://github.com/yitter/IdGenerator
Canonical: https://ross.abutalabs.com/products/idgenerator
Language: C
License: MIT
License Family: permissive
Topics: snowflake, idgenerator, dotnet, rust, java, go, twritter-snowflake, c-sharp, unique-id, typescript, javascript, sql, php, c, delphi, pascal
Last push: 2025-04-10T05:37:55+00:00

## Health v2 (maintenance only)
Score: 30/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 15, release rhythm 8, longevity 100
- inputs: {"age_days": 1999, "days_push": 510, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3207, forks 425 (observed 2026-08-28T04:07:48.642693+00:00)

## What it is
A high-performance unique numeric ID generator library implementing an optimized Snowflake ('drift') algorithm, natively available in C#, Java, Go, Rust, C, JavaScript, TypeScript, Python, Pascal, and more via FFI. It generates short, monotonically increasing 64-bit IDs suitable for distributed database primary keys, with automatic WorkerId registration in container environments like Kubernetes.

## Use cases
- generate unique primary keys for distributed databases
- generate short snowflake-style IDs that fit in JavaScript Number
- generate unique IDs across sharded databases
- auto-register worker IDs when scaling in kubernetes
- generate monotonic IDs at very high concurrency
- replace GUIDs with shorter sortable numeric IDs
- handle clock rollback when generating IDs

## When to choose
- you need compact, time-ordered numeric IDs for distributed systems or sharded tables
- you need extremely high ID generation throughput (hundreds of thousands per second)
- you want a dependency-free ID generator usable across many programming languages
- you deploy in containers and need automatic WorkerId registration
- you need to keep generated IDs within JavaScript's Number.MAX_SAFE_INTEGER for decades

## When to avoid
- you need UUID/GUID-format identifiers or string IDs
- you require strictly consecutive (gap-free) sequential IDs
- your system cannot guarantee a globally unique WorkerId per instance
- you depend on an external service like Redis for ID allocation and prefer that model

## Facets
- artifact type: library
- maturity: active
- function: database, concurrency, developer-tools
- domain: databases, microservices, backend, developer-tools
- platform: cross-platform, dotnet, jvm, go, rust, cpp, python, php, c
- tags: snowflake, unique-id, id-generation, distributed-systems, primary-key, snowflake-drift-algorithm, multi-language, kubernetes, nodejs

## Member repositories
- yitter/IdGenerator (main) score 30

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:48.642693+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:24:45.891796+00:00, confidence not recorded.
  - readme: https://github.com/yitter/IdGenerator (fetched 2026-08-28T04:07:48.642693+00:00, sha 17558103ead4)
- Data as of 2026-08-30T08:39:29.467469+00:00.
