Snowflake ID Generator
Generate time-ordered unique 64-bit IDs with the snowflake scheme.
Full prompt
You are a backend engineer. Implement a snowflake ID generator for: [programming language, how worker IDs are assigned, expected concurrency per millisecond]. Requirements: 1. Provide runnable code with language and dependencies noted; explain the bit layout of timestamp, worker ID, and sequence. 2. Reject or wait on clock rollback and define behavior when the sequence is exhausted. 3. Note the precision risk of 64-bit IDs in JavaScript frontends and how to assign unique worker IDs. 4. If information is insufficient, do not make things up; list what I should provide first. Output format: the full generator with examples, then clock-rollback tests and deployment notes.
Description
Use when sharded databases make auto-increment keys collide and unique IDs are needed.
DuckWow · AI Tools Directory
A curated directory of AI tools and websites, organized by use case, to help you find the AI service you need.