Decodificar ID Snowflake
snowflake-decodeDecodifica un ID Snowflake de 64 bits (Twitter/X, Discord o época propia) en fecha, trabajador y secuencia. Cuándo: hay que generar un identificador en este formato o leer los campos que lleva dentro. No para: construir un ID Snowflake (snowflake-encode). 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: Decodes a 64-bit Snowflake ID into timestamp, worker/process and sequence using the Twitter/X or Discord layout and epoch, or a custom epoch. When: an identifier has to be generated in this format or its embedded fields decoded. Not for: building a 64-bit Snowflake ID (snowflake-encode). 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 |
|---|---|---|---|
| id | Yes | Snowflake ID as decimal string (string; required; pattern ^\d{1,20}$). | |
| flavor | No | Layout/epoch (optional; one of: twitter, discord, custom; default "twitter"). | |
| epoch_ms | No | Custom epoch (ms) when flavor=custom (integer; optional; min 0; max 4102444800000). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sequence | No | ||
| timestamp | No | ||
| worker_id | No | ||
| machine_id | No | ||
| process_id | No | ||
| timestamp_ms | No |