Firmar JWT (HMAC)
jwt-sign-hmacCrea un JWT firmado con HS256/384/512 usando un secreto propio; las claims se firman tal cual. Cuándo: hay que leer, construir o revisar con exactitud una URL, una cabecera HTTP, un token, una versión, un rango de IP, un documento HTML o Markdown o un archivo para agentes. No para: comprobar sin conexión un JWT firmado con HMAC (jwt-verify-hmac). 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: Creates a compact JWS/JWT signed with HS256, HS384 or HS512 using a provided secret, e.g. for test fixtures or service-to-service tokens. Claims are signed as given; no defaults are added. When: a URL, HTTP header, token, version string, IP range, HTML or Markdown document or agent-readiness file has to be parsed, built or checked exactly. Not for: checking an HMAC-signed JWT (jwt-verify-hmac). [EN completo / full EN: inputSchema.description]
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| header | No | Extra header fields (object; optional; default {}). | |
| secret | Yes | HMAC secret (string; required; at least 1 chars; up to 4096 chars). | |
| payload | Yes | Claims object (object; required). | |
| algorithm | No | Algorithm (optional; one of: HS256, HS384, HS512; default "HS256"). | HS256 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| token | No |