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

facturahub-verifactu-hash

v0.1.0

Published

Huella (hash SHA-256 encadenado) de registros Veri*Factu según la especificación oficial de la AEAT. Isomorfo, sin dependencias.

Readme

facturahub-verifactu-hash

Parte del ecosistema FacturaHub — facturación en España, Verifactu, IVA, Modelo 303 y automatización fiscal con IA.

Calcula la huella (hash SHA-256 encadenado) de los registros Veri*Factu según la especificación oficial de la AEAT. Isomorfo (Node 18+ / navegador) · 0 dependencias · MIT.

Instalación

npm i facturahub-verifactu-hash

Uso

import { huellaAlta, cadenaAlta } from 'facturahub-verifactu-hash';

const huella = await huellaAlta({
  idEmisor: '89890001K',
  numSerie: '12345678/G33',
  fechaExpedicion: '01-01-2024',
  tipoFactura: 'F1',
  cuotaTotal: '12.35',
  importeTotal: '123.45',
  huellaAnterior: '',                 // vacío en la primera factura; si no, la huella anterior
  fechaHoraHusoGenRegistro: '2024-01-01T19:20:30+01:00',
});
// '3C464DAF61ACB827C65FDA19F352A4E3BDC2C640E9E9FC4CC058073F38F12F60'

Este resultado coincide con el vector oficial de la AEAT (verificado en los tests).

API

| Función | Qué hace | |---|---| | huellaAlta(registro) | Promise<string> — huella de un registro de alta (encadenada) | | cadenaAlta(registro) | Cadena canónica antes de hashear (para depurar) | | sha256HexUpper(str) | SHA-256 de una cadena UTF-8 en hex mayúsculas |

Cómo funciona

La AEAT exige que cada registro de facturación lleve una huella SHA-256 que encadena con la del registro anterior (integridad e inalterabilidad). La cadena se construye con los campos en orden fijo:

IDEmisorFactura=…&NumSerieFactura=…&FechaExpedicionFactura=…&TipoFactura=…&CuotaTotal=…&ImporteTotal=…&Huella=…&FechaHoraHusoGenRegistro=…

y se aplica SHA-256 (UTF-8) → hexadecimal en mayúsculas (64 caracteres). Base legal: Orden HAC/1177/2024.

Documentación técnica, no asesoramiento fiscal. Verifica siempre la especificación vigente en la sede de la AEAT.


Hecho por FacturaHub — facturación con IA para autónomos en España: emite Verifactu sin pelearte con la norma. Gratis. Guía: github.com/FacturaHub-com/facturahub-verifactu.

Ecosistema FacturaHub

  • 🌐 FacturaHub — la app (gratis, Verifactu incluido)
  • 🔌 facturahub-api — API REST + OpenAPI 3.1
  • 🤖 facturahub-mcp — servidor MCP (Claude, Cursor, ChatGPT)
  • 🧾 facturahub-verifactu — Verifactu por API
  • 🧮 Librerías: nif-validator · iva · iban-es · factura-number · verifactu-qr · verifactu-hash · modelo-303
  • ⚙️ Automatización: facturahub-n8n · n8n-nodes-facturahub · facturahub-woocommerce · facturahub-shopify

Temas: Verifactu · Facturación electrónica · IVA · Modelo 303 · AEAT · NIF/CIF · Autónomos · MCP · IA · España