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

@neykoor/curve25519-ts

v0.0.13

Published

TypeScript implementation of Curve25519 (X25519 key agreement and Ed25519-style signing)

Readme

curve25519-ts

Fork de curve25519-js (Harvey Connor, basado en axlsign.js/TweetNaCl) renombrado como curve25519-ts.

API pública sin cambios: generateKeyPair(seed), sharedKey(secretKey, publicKey), sign(secretKey, msg, opt_random?), verify(publicKey, msg, signature), signMessage, openMessage.

Cambios respecto al original

  • sharedKey() rechaza claves públicas de orden bajo. Si el resultado del intercambio Diffie-Hellman (X25519) es todo-cero (lo que ocurre con la clave pública 0x00...00 u otros puntos de orden bajo conocidos), ahora lanza Error('invalid public key (low-order point)') en vez de devolver un secreto compartido predecible en silencio.
  • curve25519_sign() limpia de memoria la clave Ed25519 derivada (edsk) inmediatamente después de firmar, en vez de dejarla en el buffer indefinidamente.
  • checkArrayTypes() corregido: usaba el objeto arguments en vez de sus propios parámetros rest declarados; ahora valida los argumentos que realmente recibe.
  • Se eliminó el export default {} (no tenía propósito y podía confundir a quien hiciera import curve25519 from 'curve25519-ts').
  • package.json ahora declara "types": "lib/index.d.ts" para que los consumidores TypeScript reciban los tipos generados por tsc automáticamente.
  • openMessage() ya no muta el signedMsg que le pasas. Antes reenviaba el array del caller directo a curve25519_sign_open, que le limpiaba el bit alto del último byte; una segunda verificación del mismo buffer fallaba con null aunque la firma fuera válida. Ahora trabaja sobre una copia.
  • tsconfig.json declara rootDir: "./src" explícito. Sin esto, algunos compiladores de TypeScript emiten en lib/src/index.js en vez de lib/index.js, rompiendo el main/types de package.json.
  • package.json agrega el script prepare, que corre el build automáticamente al instalar el paquete como dependencia de git o antes de npm publish, para no volver a publicar/consumir el paquete sin lib//lib-esm/ compilados.
  • Limpieza de memoria extendida a todos los buffers intermedios con material de clave. crypto_scalarmult() limpia el escalar clampeado (z) tras el intercambio; crypto_sign_direct() y crypto_sign_direct_rnd() limpian el nonce derivado (r), el hash intermedio (h) y el acumulador (x) tras firmar.
  • Tipado explícito en toda la librería. Se eliminó any de todas las firmas internas y públicas a favor de Uint8Array, Float64Array/GF y Point ([GF, GF, GF, GF]), con export interface KeyPair.
  • Migrado de tslint (deprecado) a ESLint (@typescript-eslint + eslint-config-prettier).
  • TypeScript actualizado a ^5.4.5 (antes ^3.5.3).
  • Build dual CommonJS + ESM. npm run build genera lib/ (CJS) y lib-esm/ (ESM); package.json declara exports map con require/import/types.
  • package.json declara files: ["lib", "lib-esm"] para controlar explícitamente qué se publica, en vez de depender solo de .npmignore.
  • Código fuente sin comentarios.

Build

npm install
npm run build

Genera lib/ (CommonJS) y lib-esm/ (ES Modules).

Lint / Format

npm run lint
npm run format