{"id":22901053,"url":"https://github.com/mpdn/sketch-duplicates","last_synced_at":"2025-04-01T05:41:10.419Z","repository":{"id":57667566,"uuid":"277351916","full_name":"mpdn/sketch-duplicates","owner":"mpdn","description":"Find duplicate lines probabilistically","archived":false,"fork":false,"pushed_at":"2020-07-05T17:41:52.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-07T17:04:06.564Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mpdn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-05T17:34:27.000Z","updated_at":"2021-04-20T20:57:53.000Z","dependencies_parsed_at":"2022-09-03T11:30:19.218Z","dependency_job_id":null,"html_url":"https://github.com/mpdn/sketch-duplicates","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpdn%2Fsketch-duplicates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpdn%2Fsketch-duplicates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpdn%2Fsketch-duplicates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpdn%2Fsketch-duplicates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mpdn","download_url":"https://codeload.github.com/mpdn/sketch-duplicates/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246591782,"owners_count":20801984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-14T01:31:28.081Z","updated_at":"2025-04-01T05:41:10.401Z","avatar_url":"https://github.com/mpdn.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sketch-duplicates\n\nFind duplicate lines probabilistically.\n\n## Motivation\n\nLet's say you have a directorty of gzipped text files that you want to check for duplicate lines in.\nThe usual way to do this might look something like this:\n\n```shell\nzcat *.gz | sort | uniq -d\n```\n\nThe problem with this, is that it can become very slow for large files. `sketch-duplicates` provides\na way to remove *most* unique lines, leaving *mostly* duplicate lines in the output.\n`sketch-duplicates` is probabilistic and is therefore not guarenteed to remove *all* unique lines.\nIt is therefore still necessary to have a `sort | uniq -d` in the end but this will be much faster\ndue to the input having most unique lines removed.\n\nThe above can example can be written to use a sketch like this:\n\n```shell\nzcat *.gz | sketch-duplicates build \u003e sketch\nzcat *.gz | sketch-duplicates filter sketch | sort | uniq -d\n```\n\nMultiple sketches can be combined using `sketch-duplicates combine`. This can be used to parallelize\nthe construction of the sketch (here using GNU Parallel):\n\n```shell\necho *.gz | parallel 'zcat {} | sketch-duplicates build' | sketch-duplicates combine \u003e sketch\necho *.gz | parallel 'zcat {} | sketch-duplicates filter sketch' | sort | uniq -d\n```\n\n## Options\n\n- `-s`, `--size`: Size of the sketch. Increasing this improves filtering accuracy but consumes more\n  memory. This is set to a conservative default of 8MiB and can often be increased depending on the\n  specific use case.\n- `-p`, `--probes`: Number of probes to do in the sketch.\n- `-0`, `--zero-terminated`: Use NULL bytes as line delimiters. \n\n## Install\n\nInstall Cargo (eg. using [rustup](https://www.rust-lang.org/tools/install)), then run\n`cargo install sketch-duplicates`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpdn%2Fsketch-duplicates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmpdn%2Fsketch-duplicates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpdn%2Fsketch-duplicates/lists"}