← Work

r-detect

I built r-detect to score how likely two browser readings come from the same device. It returns a number from 0 to 100 with the reasons behind it, and never an ID.

  • TypeScript
  • WebGL
  • Web Crypto
  • ESM
  • npm
npm install r-detect

The problem

A fingerprint hashed into one device ID treats two phones of the same model as one device. In the field deployment behind the default weights (1,217 browsers, 91% Android), 34% of browsers had at least one other browser identical on every part.

A bare ID also explains nothing. When an account is flagged, there is no way to say which signals agreed and which did not.

The approach

collect() reads what a page can see without a permission prompt and hashes it into ten parts with SHA-256. Each part has a weight measured as a log-likelihood ratio, and the ten weights total 72.

compare() returns a score, a band (none, weak, similar, strong), coverage and a list of reasons that always sums to the score. The strong band starts at 80, so device parts alone cannot reach it. The same network or a recent battery level has to agree.

On the server, parseReading() validates client input, sealReading() re-hashes every part with HMAC-SHA256 under your key, and bestMatch() compares one sealed reading with a list of earlier ones.

The result

I published r-detect 0.1.0 on npm as ESM with TypeScript types, no runtime dependencies and 70 tests. The library makes no network request and stores nothing. It is browser fingerprinting, and the README lists what was not tested, including iOS and desktop.