kar-shingle v1 · offline · no AI judge

Deterministic Near-Duplicate Verifier

Word-shingled MinHash you can recompute by hand — not an AI opinion about "how similar" two texts are.

Paste two documents. This page splits each into overlapping K-word shingles, hashes them with SHA-256, and estimates their Jaccard similarity using a fixed, published MinHash permutation scheme. The verdict — IDENTICAL / NEAR-DUPLICATE / OVERLAPPING / DISTINCT — and the receipt hash beneath it are fully re-derivable: anyone with the same two texts and the algorithm spec below gets the exact same bytes back. No model reads your text and no server ever sees it — everything runs in this tab.

Start here

Kar-Shingle tells you how much word-for-word text two documents share: whether one was copied, padded or lightly reworded from the other. It runs entirely in this page: nothing you paste is sent anywhere, and no AI judges anything.

  1. Paste document A and document B above.
  2. Press Compute verdict.
  3. Read the verdict: IDENTICAL, NEAR-DUPLICATE, OVERLAPPING or DISTINCT, with the estimated share of word sequences they have in common.
  4. Keep the receipt: Copy full receipt JSON, and anyone can re-check it against the same two texts.

Below the tool: how it works · words on this page · blueprint · roll it out · for a business · FAQ

Self-test — runs on load

Running self-test…

Documents

0 words
0 words

Algorithm spec — how to recompute this yourself

  1. Normalize: lowercase the text, collapse all whitespace runs to a single space, trim the ends.
  2. Shingle: split the normalized text on spaces into words; for shingle size K, take every contiguous run of K words and join them with a single space. Deduplicate (a document's shingle set is a set, not a multiset). If the document has fewer than K words, it has zero shingles.
  3. Base hash: for each unique shingle s, compute SHA-256(s) (UTF-8 bytes), take the first 8 hex characters, and read them as an unsigned 32-bit integer h0(s).
  4. Permutations: for i = 0 … N-1, derive fixed constants once — a_i = first 32 bits of SHA-256("kar-shingle-perm-a-" + i), forced odd (a_i | 1); b_i = first 32 bits of SHA-256("kar-shingle-perm-b-" + i). These sixteen-to-256 constants are the same for every user, every run, forever — they are not random per session.
  5. Per-permutation hash: h_i(s) = (a_i · h0(s) + b_i) mod 2^32, computed with 64-bit-safe (BigInt) arithmetic to avoid overflow.
  6. MinHash signature: signature slot i of a document = min over all its shingles s of h_i(s). A document with zero shingles has no signature ("insufficient data").
  7. Similarity: estimated Jaccard similarity of A and B = (number of slots where sigA[i] === sigB[i]) / N. This is a standard unbiased MinHash estimator; its standard error is roughly sqrt(p(1-p)/N), so more hash functions narrow the estimate at the cost of more computation.
  8. Verdict: if SHA-256(normalize(A)) === SHA-256(normalize(B)) → IDENTICAL (similarity is trivially 1.0). Else if similarity ≥ 0.75 → NEAR-DUPLICATE. Else if similarity ≥ 0.35 → OVERLAPPING. Else → DISTINCT. If either document has zero shingles → INSUFFICIENT-DATA.
  9. Receipt: a canonical (sorted-key, whitespace-free) JSON object containing the algorithm id, K, N, and for each document its shingle count, normalized-text SHA-256, and signature SHA-256 (SHA-256 of the signature's 32-bit words as 8-hex-char blocks, concatenated) plus the similarity match count and verdict. The receipt hash is SHA-256 of that canonical string. Wall-clock time is shown for humans but deliberately excluded from the hash.

This is the entire algorithm — there is nothing else in the page that touches your text. View source to check; there are no network calls anywhere in this document.

Limits: what it does not check

How it works

text A and Bword shinglesMinHash estimateIDENTICALNEAR-DUPLICATEOVERLAPPINGDISTINCT
  1. Both texts are normalised and cut into shingles: every run of a few consecutive words.
  2. MinHash, with permutations derived from SHA-256, estimates the share of shingles the two texts have in common (the Jaccard similarity).
  3. The same normalised text is IDENTICAL; a similarity of 0.75 or more is NEAR-DUPLICATE; 0.35 or more is OVERLAPPING; below that, DISTINCT.

Words on this page

Shingle
A run of 5 words in a row. Two texts that share many shingles share passages, in order.
MinHash
A fixed-size summary of a text's shingles: 64 numbers. The share of the 64 that match between two texts estimates how much they share, and keeps long texts fast to compare.
The verdicts
IDENTICAL: the same text after case and spacing are evened out. NEAR-DUPLICATE: 75% or more of the 64 numbers match. OVERLAPPING: 35% or more. DISTINCT: less.
Kernel
The small piece of code that decides every verdict; the rest of the page only shows what it decided. Here it is the block inside this page, copied byte for byte into kernel.mjs (the file the tests run) and into the script, so all three are the same code.
SHA-256 receipt
A 64-character fingerprint of the input and the verdict. Anyone with the same input gets the same fingerprint; change one character and it changes completely.
Deterministic
No AI model, no random numbers and no clock go into a verdict, so the same input gives the same verdict on any machine, every time.
No AI judge
No language model decides anything. The verdict comes from fixed rules you can read in kernel.mjs.
Mutation gate
A test of the tests. witness makes small deliberate changes to the kernel, one at a time: for example it turns if (count > 0) into if (count >= 0), then runs the tests. Every change must make a test fail. A change no test notices has survived: it would mean no test checks what happens at that exact point. A change reviewed as equivalent cannot alter any result (both versions give the same answer for every input), and the reason is written down and checked.
CI
Continuous integration: GitHub re-runs every test and the gate on its own computers on every change, and the runs are public.
In the browser
The page does the work on your computer. Nothing you paste is sent to a server.
MIT licence
An open-source licence: you may use, copy, change and build products with it, free, as long as the copyright notice stays.
Sourced figures
Every number in the cost case comes from a published source (the UK median wage and UK inflation, from the ONS), linked under the table.

Blueprint

Roll it out

  1. Pick one place where this check is done by hand today, or skipped, and the person who owns it.
  2. Try it here on real examples from that place. Nothing leaves the page.
  3. Put it in the flow. Run node scripts/kar-shingle.mjs a.txt b.txt in CI or a script (Node.js 20 or later, no dependencies). It prints the verdict as JSON and exits 0 whenever a verdict was computed (2 if the input could not be read), so your step acts on the verdict, not the exit code. An AI agent can run the same script as a skill.
  4. Keep the receipts with the work they checked, so anyone can recompute a verdict later.
  5. Measure the difference with the cost case below.

For a business

Kar-Shingle turns a check that is usually done by eye, or not at all, into a verdict anyone can recompute: the same input gives the same answer and the same SHA-256 receipt on any machine, with no AI judging it.

The cost case, on your numbers

What the checking costs today against running the tool. Staff time is at the UK median hourly wage with on-costs left out, so this is a floor; later years rise with UK inflation (CPI). Change any box to your own numbers and the table recalculates as you type.

How it is worked out. Today: checks a year (per week × 52) × minutes per check × the median hourly wage, plus anything you pay for a tool now. With the tool: the share it replaces takes the seconds you enter instead of the minutes, and the rest is still checked by hand. Each later year rises by one more year of inflation.

yearchecking by handwith Kar-Shinglesaved

Against what you do now

Security, data protection and deployment

Support and ownership

Supplied by AI Native Solutions; start through that site. Support, any service level, warranty and liability are agreed per deployment, in each deployment's agreement. The software is MIT and keeps running without us.

Where it stops, answered straight

The case for the board

A check that anyone can recompute replaces a check that has to be trusted, at no licence cost, without sending your data anywhere. Its logic is the code on this page, and its tests are themselves tested.

FAQ

Why not just compare the words?
Shingles keep word order, so a copied passage is found even if it moves; MinHash keeps the comparison fast on long texts.
Can an agent run it?
Yes. The same kernel ships as a one-file Node.js script (scripts/kar-shingle.mjs), usable as an agent skill before it publishes generated text.
What happens with bad, empty or very large input?
A text over 200,000 characters is cut to its first 200,000 before hashing, and the page says so. A text too short to make one 5-word shingle gets INSUFFICIENT-DATA, not a score. An input file the script cannot read is refused (exit 2).
What do I need to run it?
For the page, a modern browser; there is nothing to install. For the script, Node.js 20 or later (free from nodejs.org; node --version shows which one you have): download scripts/kar-shingle.mjs (one file, no dependencies, no npm install) and run it with no arguments to see how to call it.
Does it need the internet or an account?
No. The page works once loaded, and the script runs offline. Nothing is uploaded.