npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

decoder-qr-pago-movil

v1.0.9

Published

Decodifica códigos QR de Pago Móvil (Suiche 7B). Compatible con 58 bancos. Funciona en Node.js, Bun y navegador.

Readme

decoder-qr-pago-movil

Decodifica y codifica códigos QR del estándar Suiche 7B (Pago Móvil Interbancario). Extrae y genera datos del beneficiario: dni, phone, bank, name, amount, description, bdv.

Compatible con más de 58 bancos. Funciona en Node.js, Bun y navegador (React, Next.js, Vite).

Instalación

bun add decoder-qr-pago-movil
# o
npm install decoder-qr-pago-movil

Uso rápido

Decodificar

import { decodeQr } from "decoder-qr-pago-movil";

const payload =
  "9fbRuC0tEp6n0rkkRa2TgAF5...?merchantId=0114&strong_id=1784217050";

const result = decodeQr(payload);
// {
//   dni:   'V00000000',
//   phone: '584260000000',
//   bank:  '0114',
//   name:  'Marco Aurelio'
// }

Codificar

import { encodeQr } from "decoder-qr-pago-movil";

const payload = encodeQr({
  dni: "12345678",
  phone: "584120000000",
  bank: "0114",
  amount: "150,00",
});

// payload: "fXr5Kt...?merchantId=0114&origin=app"

API

decodeQr(payload: string): QrData

Parsea y descifra el QR. Retorna:

| Campo | Tipo | Ejemplo | | ------------- | ------------------ | --------------- | | dni | string | V00000000 | | phone | string | 584260000000 | | bank | string | 0114 | | name | string (opcional) | Marco Aurelio | | amount | string (opcional) | 150,00 | | description | string (opcional) | Pago alquiler | | bdv | string (opcional) | 1234567890123456 |

El campo id del JSON original se mapea a dni y se le antepone V si no lo trae. El campo description no es aceptado por todos los bancos. Verifica con tu entidad antes de usarlo.

encodeQr(data: QrData): string

Genera un payload QR codificado con AES-256-CBC. bank es el código del merchant (mismo que merchantId). Todos los campos opcionales se incluyen solo si tienen valor.

| Campo | Tipo | Obligatorio | | ------------- | ------- | ----------- | | dni | string | Sí | | phone | string | Sí | | bank | string | Sí | | name | string | No | | amount | string | No | | description | string | No | | bdv | string | No |

El amount se valida y auto-corrige automáticamente: 150150,00, 150.5150,50, 150.00150,00. El campo description no es aceptado por todos los bancos. Verifica con tu entidad antes de usarlo.

QrCodec (clase)

Para crear múltiples codificadores/decodificadores o inyectar claves manualmente:

import { QrCodec } from "decoder-qr-pago-movil";

const codec = new QrCodec({ aesKeys, rsaKeys });
const result = codec.decode(payload);
const newPayload = codec.encode({ dni: "12345678", phone: "584120000000", bank: "0114" });

Tipos

export interface QrData {
  dni: string;
  phone: string;
  bank: string;
  name?: string;
  amount?: string;
  description?: string;
  bdv?: string;
}

export interface KeyMaps {
  aesKeys: Record<string, { key: string; iv: string }>;
  rsaKeys: Record<string, string>;
}

Formatos

| Archivo | Formato | Target | | --------------------------------------- | ------- | -------------------------- | | dist/decoder-qr-pago-movil.js | ESM | Node.js / Bun | | dist/decoder-qr-pago-movil.cjs | CJS | Node.js | | dist/decoder-qr-pago-movil.browser.js | ESM | Navegador / Vite / Next.js |

Características

  • 58+ bancos compatibles
  • Decodificación AES-256-CBC + RSA PKCS1 v1.5
  • Codificación AES-256-CBC con validación de montos
  • Sin dependencias nativas (usa node-forge)
  • Funciona en cliente (browser) sin bundlers especiales
  • Claves pre-procesadas (no necesita Blowfish en runtime)

Licencia

MIT