Try it

The library is running on this server. Everything below was computed when you asked for the page.

Two texts

simhash-v1 gives a text 64 bits; texts that share most of their words get bits that mostly agree. minhash-v1 gives a text 128 numbers, and the share of them two texts have in common estimates how much of the texts is shared.

For simhash-v1, split each text into

What you type travels in this page's address, so it reaches the server's log like any address does. Nothing else keeps it. Up to 600 characters each; don't paste anything private.

9 of 64 bits differ.

First text

Second text

Where they differ

Each square is one bit, read row by row from the top left. Filled is 1.
First text
simhash-v1:f40648546db2f419 from 47 words
Second text
simhash-v1:f606e83c6d92f099 from 47 words

Two unrelated texts differ in about 32 bits, half of them, as two coin-flipped rows would. A text under about 50 words gives the hash little to go on, so short texts can land close together or far apart by chance.

minhash-v1 puts the share of the two texts in common at about 0.70.

Each square is one of the 128 values, filled where the two texts have the same one: 89 of 128. Each text is cut into every run of five characters, 236 of them in the first and 232 in the second.

Unlike the 64 bits above, this number means something by itself: it is an estimate, good to a few hundredths, of the share of five-character runs the two texts have in common. It holds up on short texts and on edited ones.

One picture, changed

Five of the definitions hash pictures: three give 64 bits and two give 256. Below, one picture is hashed beside eight changed copies of itself and one different picture. Each number is how many bits moved.

A squat stoneware jar with a wide mouth and a dull green glaze, stamped with bands of small marks.
Tea Caddy with Stamped Floral Decoration, Korea, 1600s. The Cleveland Museum of Art, Open Access (CC0). Shown and hashed at 320 by 218 pixels.
Bits that differ from the picture above
Copy, and what was done to it average-v1
of 64
difference-v1
of 64
perceptual-v1
of 64
pdq-v1
of 256
blockhash-v1
of 256
Saved again as a JPEG at quality 30 0 1 0 4 4
Shrunk to half the size 0 0 0 22 0
Made brighter 1 0 0 2 0
Colour removed 0 1 2 0 2
A twentieth cut from every edge 8 3 10 104 30
A black border added 32 14 10 86 84
Turned by three degrees 18 17 10 64 62
Mirrored left to right 6 12 30 126 32
A different picture: Lobed vase with underglaze cobalt blue decoration 37 33 28 134 120

Saving the picture again or changing its brightness moves few bits or none. Cutting off its edges, adding a border or turning it moves more, because every part of the picture shifts under the grid the hash is read from. A different picture sits about half the bits away under most of these hashes, which is what chance gives.

The mirrored copy is worth following from picture to picture. perceptual-v1 and pdq-v1 put it about as far away as a different picture, for every picture here. average-v1 and difference-v1 compare broad areas of light and dark, so a picture that is nearly symmetric, such as the vase, is almost its own mirror image to them. average-v1 is the weakest of the five: it can put two different landscapes a few bits apart.

Look at the half-size row. The 64-bit hashes barely notice, and pdq-v1 does: it reads fine detail, and these pictures are small to begin with. That is why the guide says to hash one size of every picture.

The ten files were read and hashed for this page in 41.0 milliseconds. The five hashes of the picture above, whose pdq-v1 quality is 100 of 100:

average-v1:fff7cbdb81c3c3c7

difference-v1:f0969a33339f1f1f

perceptual-v1:b9c6c7388e61b139

pdq-v1:71b313dbd26c386c8f4cc5383e334713f0d3b86ec3c648cb3d3c2f0ec0f1c4b1

blockhash-v1:07f80ffc1ffc080cf80ff04fe007e187e1c7e047f00ff00fe00fe007e00ff87f

What this page is

The site depends on legit-hashes 0.2.0 as published, with its image feature. Nothing on this page is stored ahead of time: asking for the page runs the hashes. The pictures are fixed, so the only thing a visitor supplies is the two short texts.

The square beside the crate's name is simhash-v1:518d561636d73f31, the hash of this page's opening sentence, computed by the crate as the page was served. Each page here has its own.