{"id":19292402,"url":"https://github.com/foolin/sumdiff","last_synced_at":"2026-05-16T06:03:12.914Z","repository":{"id":211125063,"uuid":"728260697","full_name":"foolin/sumdiff","owner":"foolin","description":"Compare tools for directory and files.","archived":false,"fork":false,"pushed_at":"2023-12-19T15:58:57.000Z","size":7215,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-12-19T17:16:07.232Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/foolin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-12-06T15:10:57.000Z","updated_at":"2023-12-21T18:35:28.608Z","dependencies_parsed_at":"2023-12-21T18:47:47.031Z","dependency_job_id":null,"html_url":"https://github.com/foolin/sumdiff","commit_stats":null,"previous_names":["foolin/sumdiff"],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foolin%2Fsumdiff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foolin%2Fsumdiff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foolin%2Fsumdiff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foolin%2Fsumdiff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/foolin","download_url":"https://codeload.github.com/foolin/sumdiff/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240395982,"owners_count":19794618,"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-11-09T22:30:37.573Z","updated_at":"2026-05-16T06:03:12.828Z","avatar_url":"https://github.com/foolin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sumdiff\nCompare sdk/tools for directory and files.\n\n## Features\n- [x] Support comparing files or directories result is equals. \n- [x] Supports comparing files or directories with the difference list. \n- [x] Support for calculating the hash of a file or directories md5/sha1/sha256/sha512. \n- [x] This library supports both SDK and CLI tools.\n- [x] CLI support result format : table/json/csv/yaml \n- [x] CLI support result output to a file.\n\n# SDK\n\n## Install\n```bash\ngo get -u github.com/foolin/sumdiff\n```\n\n## API\n```go\n\n//Compare \nok, result, err := sumdiff.Cmp(path1, path2)\n\n//Equal\nok, err := sumdiff.Equal(v.path1, v.path2)\n\n```\n\n# CLI Tool\n\n```\nsumdiff  --help\n\nA useful comparison tool for differences and hash\n\nUsage:\n  sumdiff [command]\n\nAvailable Commands:\n  cmp         Compare the two files or directories are different\n  completion  Generate the autocompletion script for the specified shell\n  eq          Compare whether two files or directory are equal\n  hash        Calculate hash algorithm [md5|sha1|sha256|sha512] hex string\n  help        Help about any command\n  md5         Calculate md5 hex string\n  sha1        Calculate sha1 hex string\n  sha256      Calculate sha256 hex string\n\nFlags:\n  -f, --format string   Format: table|json|csv|yaml (default \"table\")\n  -h, --help            help for sumdiff\n  -o, --output string   Output filename\n  -v, --verbose         Verbose output info\n\nUse \"sumdiff [command] --help\" for more information about a command.\n\n\n```\n\n# Usage\n\n### `sumdiff eq` - Compare equal\n* Compare the two files or directories are equal\n  `sumdiff eq \u003cpath1\u003e \u003cpath2\u003e`\n\n  Example1:\n    ```shell\n    sumdiff eq test_data/a.txt test_data/b.txt \n    ```\n  Output1:\n    ```text                                                                               \n    +--------+                                                                                          \n    | result |\n    +--------+\n    |  true  |\n    +--------+\n    ```\n    \n  Example2:\n    ```shell\n    sumdiff eq test_data/c.txt test_data/d.txt \n    ```\n  Output2:\n    ```text                                                                                                                                                                    \n    false\n    ```\n\n\n\n### `sumdiff cmp` - Compare different true or false\n* Compare the two file or directory differences\n  `sumdiff diff \u003cpath1\u003e \u003cpath2\u003e`\n\nExample:\n  ```shell\n  sumdiff cmp test_data/data1 test_data/data3\n  ```\nOutput:\n  ```text                                                                               \n  +-------------------------------------------+                                                       \n  | Path   | OK    | Msg                      |\n  +-------------------------------------------+\n  |        | true  |                          |\n  | /a.txt | true  |                          |\n  | /b.txt | true  |                          |\n  | /c.txt | false | path1 not exist [/c.txt] |\n  +-------------------------------------------+\n  false\n  ```\n\n\n### `sumdiff md5` - Get MD5 hash value\n  Calculate the MD5 hexadecimal value of the files or directories\n  `sumdiff md5 \u003cpath1\u003e [\u003cpath2\u003e] [\u003cpath3\u003e] ...`\n  \n  Example:\n  ```shell\n  sumdiff md5 test_data/a.txt\n  ```\n  Output:\n  ```text                                                                               \n  +-----------------------------------------------------------+                                       \n  | Hash                             | Size | Path            |\n  +-----------------------------------------------------------+\n  | 9d15fa011b54dbd079d1d20e36e4a358 | 212  | test_data/a.txt |\n  +-----------------------------------------------------------+\n  ```\n\n### `sumdiff sha1` - Get SHA1 hash value\n  Calculate the MD5 hexadecimal value of the files or directories\n  `sumdiff sha1 \u003cpath1\u003e [\u003cpath2\u003e] [\u003cpath3\u003e] ...`\n  \n  Example:\n  ```shell\n  sumdiff sha1 test_data/data1\n  ```\n  Output:\n  ```text                                                                               \n  +---------------------------------------------------------------+                                   \n  | Hash                                     | Size | Path        |\n  +---------------------------------------------------------------+\n  | 18b012c3e30bf822589ac96fd4d87e6e8d89754e | 4096 | data1/a.txt |\n  | 9c678f3b44c0918f5695e5a0a8232ab1b017a4a4 | 4096 | data1/b.txt |\n  +---------------------------------------------------------------+\n  ```\n\n### `sumdiff sha256` - Get SHA256 hash value\n  `sumdiff sha256 \u003cpath1\u003e [\u003cpath2\u003e] [\u003cpath3\u003e] ...`\n  \n  Example:\n  ```shell\n  sumdiff sha256 test_data/a.txt test_data/c.txt\n  ```\n  Output:\n  ```text                                                                               \n  +-------------------------------------------------------------------------------------------+       \n  | Hash                                                             | Size | Path            |\n  +-------------------------------------------------------------------------------------------+\n  | bb3cf386d0c975847024b0d78c9f92c0657c894f16c1db1248233cfe2b05b65f | 212  | test_data/a.txt |\n  | 732d2d9a2c39480fa38bd060f07b3e55eb3b47888e8019a8d4cfd8600d5c104f | 222  | test_data/c.txt |\n  +-------------------------------------------------------------------------------------------+\n  ```\n\n### `sumdiff hash` - Get Other hash value \n  Calculate the  hash(md5|sha1|sha256|sha512) value of a file or directory\n  `sumdiff hash \u003cmd5|sha1|sha256|sha512\u003e \u003cpath1\u003e [\u003cpath2\u003e] [\u003cpath3\u003e] ...`\n  \n  Example:\n  ```shell\n  sumdiff hash sha512 test_data/a.txt\n  ```\n  Output:\n  ```text                                                                               \n  +-----------------------------------------------------------------------------------------------------------------------------------------------------------+\n  | Hash                                                                                                                             | Size | Path            |\n  +-----------------------------------------------------------------------------------------------------------------------------------------------------------+\n  | 9683aedddcc5b16548f3510580d91306fad405070fd516299e3f5609bff5fd950a1a6e39e8bce5000d4f3c264428855eb2ae0f235f55d89bd9ec2c9f02c86c4b | 212  | test_data/a.txt |\n  +-----------------------------------------------------------------------------------------------------------------------------------------------------------+\n  ```\n\n## Help\n`sumdiff -h`\n\n\n## Install\n\nlinux:\n```shell\n\ntar -xvf sumdiff_Linux_x86_64.tar.gz \u0026\u0026 sudo mv sumdiff /usr/local/bin\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoolin%2Fsumdiff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoolin%2Fsumdiff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoolin%2Fsumdiff/lists"}