Validar Luhn (módulo 10)
luhn-validateValida un número con el algoritmo de Luhn (mod 10): tarjetas, IMEI y varios documentos. Cuándo: hay que verificar sin conexión el formato y el dígito de control de un identificador antes de usarlo. No para: detectar la franquicia de una tarjeta por su prefijo, valida longitud y Luhn y devolver el número enmascarado (card-brand-detect). 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 number with the Luhn mod-10 checksum (credit cards, IMEI, many national IDs); spaces and dashes are ignored. When: an identifier's format and check digit have to be verified offline before it is used. Not for: detecting a payment card brand from its IIN prefix (card-brand-detect). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. [EN completo / full EN: inputSchema.description]
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| number | Yes | Digits (string; required; up to 64 chars). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| valid | No | ||
| reason | No |