Decodificar ObjectId de MongoDB
objectid-decodeValida un ObjectId de MongoDB y extrae su fecha de creación. Cuándo: hay que generar un identificador en este formato o leer los campos que lleva dentro. No para: decodificar un KSUID de 27 caracteres en fecha y payload de 128 bits (ksuid-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: Validates a 24-hex MongoDB ObjectId and extracts its embedded creation time (seconds precision) and the random/counter parts. When: an identifier has to be generated in this format or its embedded fields decoded. Not for: decoding a 27-char base62 KSUID into its timestamp (ksuid-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 |
|---|---|---|---|
| objectid | Yes | 24 hex chars (string; required; up to 64 chars). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| valid | No | ||
| counter | No | ||
| timestamp | No | ||
| random_hex | No | ||
| timestamp_s | No |