Construir ID Snowflake
snowflake-encodeConstruye un ID Snowflake (estilo Twitter 41/10/12 bits) desde marca de tiempo, máquina y secuencia. Cuándo: hay que generar un identificador en este formato o leer los campos que lleva dentro. No para: decodificar un ID Snowflake en su marca de tiempo y sus partes (snowflake-decode). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.
EN: Builds a 64-bit Snowflake ID (Twitter-style 41/10/12 bit layout) from a timestamp, machine ID and sequence, for a given epoch. When: an identifier has to be generated in this format or its embedded fields decoded. Not for: decoding a Snowflake ID into its timestamp and parts (snowflake-decode). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| epoch_ms | No | Epoch ms (default Twitter 1288834974657) (integer; optional; default 1288834974657; min 0; max 8640000000000000). | |
| sequence | No | 0-4095 (integer; optional; default 0; min 0; max 4095). | |
| machine_id | No | 0-1023 (integer; optional; default 0; min 0; max 1023). | |
| timestamp_ms | Yes | Unix ms (integer; required; min 0; max 8640000000000000). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No |