Marketplace móvil para negocios locales mexicanos. Estructura inicial: - apps/backend (NestJS API) - apps/frontend (React Web) - apps/mobile (Expo/React Native) - apps/mcp-server (Claude MCP Server) - apps/whatsapp-service (WhatsApp Business API) - database/ (PostgreSQL DDL) - docs/ (Documentación) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
20 lines
591 B
JavaScript
20 lines
591 B
JavaScript
import { JOSENotSupported } from '../util/errors.js';
|
|
export function bitLength(alg) {
|
|
switch (alg) {
|
|
case 'A128GCM':
|
|
case 'A128GCMKW':
|
|
case 'A192GCM':
|
|
case 'A192GCMKW':
|
|
case 'A256GCM':
|
|
case 'A256GCMKW':
|
|
return 96;
|
|
case 'A128CBC-HS256':
|
|
case 'A192CBC-HS384':
|
|
case 'A256CBC-HS512':
|
|
return 128;
|
|
default:
|
|
throw new JOSENotSupported(`Unsupported JWE Algorithm: ${alg}`);
|
|
}
|
|
}
|
|
export const generateIv = (alg) => crypto.getRandomValues(new Uint8Array(bitLength(alg) >> 3));
|