{"id":40845040,"url":"https://github.com/amoghe/dedup","last_synced_at":"2026-01-21T23:12:19.222Z","repository":{"id":57526969,"uuid":"95938398","full_name":"amoghe/dedup","owner":"amoghe","description":"Deduplicator","archived":false,"fork":false,"pushed_at":"2017-08-09T00:39:33.000Z","size":39,"stargazers_count":4,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-15T09:52:21.013Z","etag":null,"topics":["compression","compressor","dedupe","deduplication"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/amoghe.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":"2017-07-01T02:59:07.000Z","updated_at":"2022-10-07T03:33:55.000Z","dependencies_parsed_at":"2022-09-07T02:52:32.182Z","dependency_job_id":null,"html_url":"https://github.com/amoghe/dedup","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/amoghe/dedup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amoghe%2Fdedup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amoghe%2Fdedup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amoghe%2Fdedup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amoghe%2Fdedup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amoghe","download_url":"https://codeload.github.com/amoghe/dedup/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amoghe%2Fdedup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28646905,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T21:29:11.980Z","status":"ssl_error","status_checked_at":"2026-01-21T21:24:31.872Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["compression","compressor","dedupe","deduplication"],"created_at":"2026-01-21T23:12:18.560Z","updated_at":"2026-01-21T23:12:19.215Z","avatar_url":"https://github.com/amoghe.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `dedup` - a deduplication tool (+ library)\n\n[![Build Status](https://travis-ci.org/amoghe/dedup.svg?branch=master)](https://travis-ci.org/amoghe/dedup) [![GoDoc](https://godoc.org/github.com/amoghe/dedup?status.svg)](http://godoc.org/github.com/amoghe/dedup)\n\n## Why\n\nDeduplication can be thought of as a coarse grained compression that detects\nduplicate data over much larger windows than most compressors work across. As\na result, deduplication is a good first step and passing deduplicated data into\na downstream compressor often results in much better compression performance\n(in terms of compression ratio and sometimes speed)\n\n## Library\n\n`dedup` is a golang lib that allows for arbitrary data to be deduplicated\n(input from an io.Reader). The `dedup.Deduplicator` and `dedup.Reduplicator`\nare the workhorses that actually do all the work. For examples on how to use\nthem, see the dedup tool itself (in `cmd/dedup/main.go`).\n\n#### Installation\n\nAs with any go(lang) pkg, you can `go get` by\n```\nshell\u003e go get github.com/amoghe/dedup\n```\n\n#### Usage\n\n```\nimport (\n  \"github.com/amoghe/dedup\"\n)\n\n// somewhere in your code\nerr := dedup.NewDeduplicator(windowSize, mask).Do(os.Stdin, os.Stdout)\n\nerr := dedup.NewReduplicator().Do(os.Stdin, os.Stdout)\n```\n\n## Binary\n\nThis codebase also builds a cmdline tool named `dedup` (see `cmd/dedup`) that\ncan be used to deduplicate data.\n\n#### Installation\n\nThe tool can be installed by either building from source\n```\nshell\u003e go get github.com/amoghe/dedup \u0026\u0026 \\\n  cd $GOPATH/src/github.com/amoghe/dedup \u0026\u0026 \\\n  go install\n```\n\nAlternatively, you can download a release binary from the Releases section of\nthis github project.\n\n#### Usage\n\nConsider this workload where we save two similar docker containers:\n\n```\nakshay@spitfire:~/$ time docker save redmine bitnami/redmine | gzip | wc --bytes\n497548816 # \u003c-- 474.49 MB (or MiB)\n\nreal  1m7.900s\nuser  0m58.536s\nsys   0m1.780s\n\nakshay@spitfire:~/$ time docker save redmine bitnami/redmine | dedup | gzip | wc --bytes\n295793793 # \u003c-- 282.09 MB (or MiB)\n\nreal  0m50.261s\nuser  0m56.312s\nsys   0m3.688s\n```\n\nAs you can see, some workloads can benefit greatly from a combination of\ndeduplication + compression (in terms of both compression ratio and speed)\n\n## Compression\n\nNote that this lib (and tool) probably won't ever support built-in support for compression of the output stream. You should pick an appropriate compressor \"downstream\" from this lib/tool. You'll find that standalone compressors such as\n`gzip`, `bzip2`, `xz` (and their parallel implementations - `pigz`, `pbzip2`,\n`pxz`) are readily available on most linux distributions. These compressors\nsupport pipelining (i.e. i/o can be pipelined via the shell) so there is no need\nfor this library to provide this functionality.\n\n## TODO:\n\n- Currently the deduplication lib consumes memory that is proportional to the\n  size of the input file. (See issue #1)\n- Document the usage and impact of the windowSize and zeroBits parameters used\n  by the `Deduplicator`\n- Add progress reporting when input is a large file (not stdin)\n- Make cmdline args fully compatible with other compression tools ('-k', '-v')\n- Add tests! (unit tests, fuzz tests)\n\n## LICENSE\n\nSee the LICENSE file\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famoghe%2Fdedup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famoghe%2Fdedup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famoghe%2Fdedup/lists"}