{"id":17308902,"url":"https://github.com/tekki/mojo-file-role-digest","last_synced_at":"2026-07-04T08:31:21.528Z","repository":{"id":56840251,"uuid":"225786503","full_name":"Tekki/mojo-file-role-digest","owner":"Tekki","description":"A role for Mojo::File to calculate digests","archived":false,"fork":false,"pushed_at":"2020-01-31T10:21:05.000Z","size":96,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T05:26:59.135Z","etag":null,"topics":["mojolicious","perl"],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tekki.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-04T05:27:53.000Z","updated_at":"2020-01-31T10:21:04.000Z","dependencies_parsed_at":"2022-08-28T22:00:15.378Z","dependency_job_id":null,"html_url":"https://github.com/Tekki/mojo-file-role-digest","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tekki%2Fmojo-file-role-digest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tekki%2Fmojo-file-role-digest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tekki%2Fmojo-file-role-digest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tekki%2Fmojo-file-role-digest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tekki","download_url":"https://codeload.github.com/Tekki/mojo-file-role-digest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245755683,"owners_count":20667027,"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":["mojolicious","perl"],"created_at":"2024-10-15T12:06:18.502Z","updated_at":"2025-10-29T22:45:44.890Z","avatar_url":"https://github.com/Tekki.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nMojo::File::Role::Digest - A role for Mojo::File to calculate digests\n\n# SYNOPSIS\n\n    # single file\n    use Mojo::File 'path';\n    my $file = path($path)-\u003ewith_roles('+Digest');\n\n    # modified file class\n    use Mojo::File;\n    my $class = Mojo::File-\u003ewith_roles('+Digest');\n    my $file = $class-\u003enew($path);\n\n    $file-\u003emd5_sum;\n    $file-\u003equickxor_hash;  # requires Digest::QuickXor\n    $file-\u003esha1_sum;\n    $file-\u003esha256_sum;\n\n# DESCRIPTION\n\n[Mojo::File::Role::Digest](https://metacpan.org/pod/Mojo%3A%3AFile%3A%3ARole%3A%3ADigest) is a role for [Mojo::File](https://metacpan.org/pod/Mojo%3A%3AFile) to calculate MD5, SHA1, SHA256, and QuickXor digests.\n\nIf the path isn't an existing file, all methods return an empty string `''`.\n\n# APPLY ROLE\n\n    use Mojo::File 'path';\n\n    my $file             = path($path);\n    my $file_with_digest = $file-\u003ewith_roles('+Digest');\n\nApply to a single [Mojo::File](https://metacpan.org/pod/Mojo%3A%3AFile) object. See [\"with\\_roles\" in Mojo::Base](https://metacpan.org/pod/Mojo%3A%3ABase#with_roles).\n\n    use Mojo::File;\n    my $class = Mojo::File-\u003ewith_roles('+Digest');\n\n    my $file1 = $class-\u003enew($path1);\n    my $file2 = $class-\u003enew($path2);\n\nCreate a modified file class with applied digest role.\n\n# METHODS\n\n## md5\\_sum\n\n    $string = $file-\u003emd5_sum;\n\nReturns the MD5 sum of the file in hexadecimal form. See [\"hexdigest\" in Digest::MD5](https://metacpan.org/pod/Digest%3A%3AMD5#hexdigest).\n\n## quickxor\\_hash\n\n    $string = $file-\u003equickxor_hash;\n\nReturns the base64 encoded QuickXorHash of the file. See [\"b64digest\" in Digest::QuickXor](https://metacpan.org/pod/Digest%3A%3AQuickXor#b64digest).\nRequires [Digest::QuickXor](https://metacpan.org/pod/Digest%3A%3AQuickXor) 0.03 or higher.\n\n## sha1\\_sum\n\n    $string = $file-\u003esha1_sum;\n\nReturns the SHA1 sum of the file in hexadecimal form. See [\"hexdigest\" in Digest::SHA](https://metacpan.org/pod/Digest%3A%3ASHA#hexdigest).\n\n## sha256\\_sum\n\n    $string = $file-\u003esha256_sum;\n\nReturns the SHA256 sum of the file in hexadecimal form. See [\"hexdigest\" in Digest::SHA](https://metacpan.org/pod/Digest%3A%3ASHA#hexdigest).\n\n# AUTHOR \u0026 COPYRIGHT\n\n© 2019–2020 by Tekki (Rolf Stöckli).\n\nThis program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.\n\n# SEE ALSO\n\n[Mojo::File](https://metacpan.org/pod/Mojo%3A%3AFile), [Mojo::Base](https://metacpan.org/pod/Mojo%3A%3ABase), [Role::Tiny](https://metacpan.org/pod/Role%3A%3ATiny), [Digest::MD5](https://metacpan.org/pod/Digest%3A%3AMD5), [Digest::QuickXor](https://metacpan.org/pod/Digest%3A%3AQuickXor), [Digest::SHA](https://metacpan.org/pod/Digest%3A%3ASHA).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftekki%2Fmojo-file-role-digest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftekki%2Fmojo-file-role-digest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftekki%2Fmojo-file-role-digest/lists"}