{"id":18295190,"url":"https://github.com/crev-dev/recursive-digest","last_synced_at":"2025-04-05T12:31:26.264Z","repository":{"id":54962936,"uuid":"237556981","full_name":"crev-dev/recursive-digest","owner":"crev-dev","description":"A recursive  file-system digest (hash)","archived":false,"fork":false,"pushed_at":"2023-04-04T20:35:12.000Z","size":30,"stargazers_count":13,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-21T03:51:15.877Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crev-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-01T03:40:53.000Z","updated_at":"2025-01-20T16:34:46.000Z","dependencies_parsed_at":"2022-08-14T07:31:12.515Z","dependency_job_id":null,"html_url":"https://github.com/crev-dev/recursive-digest","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/crev-dev%2Frecursive-digest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crev-dev%2Frecursive-digest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crev-dev%2Frecursive-digest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crev-dev%2Frecursive-digest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crev-dev","download_url":"https://codeload.github.com/crev-dev/recursive-digest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247338786,"owners_count":20922996,"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-05T14:33:53.273Z","updated_at":"2025-04-05T12:31:21.253Z","avatar_url":"https://github.com/crev-dev.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Recursive file-system digest\n\nThis library implements a simple but efficient recursive file-system digest\nalgorithm. You have a directory with some content in it, and you'd like\na cryptographical digest (hash) of its content.\n\nIt was created for the purpose of checksuming source code packages\nin `crev`, but it is generic and can be used for any other purpose.\n\n## Algorithm\n\nGiven any digest algorithm `H` (a Hash function algorithm),\na `RecursiveDigest(H, path)` is:\n\n* for a file: `H(\"F\" || file_content)`\n* for a symlink: `H(\"L\" || symlink_content)`\n* for a directory: `H(\"D\" || directory_content)`\n\nAs you can see a one-letter ASCII prefix is used to make it impossible\nto create a file that has the same digest as a directory,\netc. The drawback of this approach is that `RecursiveDigest(H, path)` of\na simple file is not the same as just a normal digest of it (`H(file_content)`) .\n\n`file_content` is just the byte content of a file.\n\n`symlink_content` is just the path the symlink is pointing to, as bytes.\n\n`directory_content` is created by:\n\n* sorting all entries of a directory by name, in ascending order,\n  using a simple byte-sequence comparison\n* for all entries concatenating pairs of:\n    * `H(entry_name)`\n    * `RecursiveDigest(H, entry_path)`\n\nIf optional additional data extensions is used, the `H(entry_name)` above becomes\n`H(entry_name || 0 || additional data)`. The format and meaning of additional\ndata is unspecified, but was intendet for fielsystem metadata like file system\npermissions and ownership.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrev-dev%2Frecursive-digest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrev-dev%2Frecursive-digest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrev-dev%2Frecursive-digest/lists"}