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 🙏

© 2025 – Pkg Stats / Ryan Hefner

device-unique-keygen

v0.1.1

Published

Generate a unique device id for each device

Readme

⚠ For educational and demonstration purposes only.

✨ Features

  • Minimal bundle size, zero runtime deps
  • Multi-format builds: ESM, CJS, Global (IIFE)
  • Works in modern browsers; graceful fallbacks when signals are blocked
  • Includes TypeScript types

📦 Installation

npm

npm i device-unique-keygen

Yarn

yarn add device-unique-keygen

📚 API

getCurrentBrowserFingerPrint(): Promise<string>

Returns a deterministic string for the current browser instance.

Under the hood, device keygen combines:

  • Audio fingerprint (OfflineAudioContext render)
  • Canvas fingerprint (styled text + canvas.toDataURL())
  • Baseline browser signals (UA, platform, vendor, hardware concurrency, device memory, screen width/height/color depth, devicePixelRatio, languages, timezone)
  • WebGL vendor/renderer (when WEBGL_debug_renderer_info is available)

All parts are concatenated and hashed via a compact 53‑bit hash (cyrb53). If the audio path fails, the library falls back to canvas + baseline signals (+ WebGL when available). If canvas is unsupported, a stable string plus baseline signals are used to avoid global collisions.

🔍 How it works

  1. Generate audio entropy using an oscillator + compressor rendered in an OfflineAudioContext, summing a slice of the buffer.
  2. Generate canvas entropy by drawing styled text and reading canvas.toDataURL().
  3. Collect baseline signals and optional WebGL vendor/renderer.
  4. Concatenate and hash to produce a compact, deterministic identifier.

Note: anti‑fingerprinting features (e.g., Brave, Firefox ETP, Safari ITP, extensions) can normalize/obfuscate signals. Broprint.js includes additional entropy to reduce collisions, but uniqueness cannot be guaranteed in all hardened environments.

🌐 Browser support

  • Modern Chromium, Firefox, and Safari
  • Graceful degradation when audio/canvas/WebGL are unavailable
  • Some privacy modes/extensions may change stability or uniqueness

🧰 Troubleshooting

  • Audio context errors: many browsers restrict audio contexts until user interaction; call after a click.
  • Identical outputs: your environment may normalize canvas/audio/WebGL; baseline signals still help differentiate.
  • Types: shipped via lib/index.d.ts.

🛠️ Build & contribute

Library build (root):

npm run build

Example app lives under example/ (Create React App).

PRs and issues welcome.

📄 License

MIT