{"id":15288748,"url":"https://github.com/sshaw/has_checksum","last_synced_at":"2026-05-06T05:33:24.501Z","repository":{"id":56875899,"uuid":"233449549","full_name":"sshaw/has_checksum","owner":"sshaw","description":"Automatically calculate checksums and signatures from the values of your class' attributes/methods","archived":false,"fork":false,"pushed_at":"2023-07-26T05:19:06.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-12T15:53:56.989Z","etag":null,"topics":["activerecord","checksum","checksum-calculation","digest","poro","rails","ruby","sha256"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/sshaw.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-12T19:53:18.000Z","updated_at":"2024-12-03T00:22:53.000Z","dependencies_parsed_at":"2024-12-01T12:42:40.545Z","dependency_job_id":null,"html_url":"https://github.com/sshaw/has_checksum","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"f5dcb653e43c0f18407386b12347c9e21435d68a"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sshaw/has_checksum","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshaw%2Fhas_checksum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshaw%2Fhas_checksum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshaw%2Fhas_checksum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshaw%2Fhas_checksum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sshaw","download_url":"https://codeload.github.com/sshaw/has_checksum/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshaw%2Fhas_checksum/sbom","scorecard":{"id":844685,"data":{"date":"2025-08-11","repo":{"name":"github.com/sshaw/has_checksum","commit":"a8f4e7ee6fb16edca35f4c9d4d6902d3369e39f7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/sshaw/has_checksum/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/sshaw/has_checksum/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/sshaw/has_checksum/ci.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/7 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-23T21:10:17.653Z","repository_id":56875899,"created_at":"2025-08-23T21:10:17.653Z","updated_at":"2025-08-23T21:10:17.653Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32680776,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T02:33:58.958Z","status":"ssl_error","status_checked_at":"2026-05-06T02:33:39.611Z","response_time":117,"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":["activerecord","checksum","checksum-calculation","digest","poro","rails","ruby","sha256"],"created_at":"2024-09-30T15:53:03.248Z","updated_at":"2026-05-06T05:33:24.476Z","avatar_url":"https://github.com/sshaw.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HasChecksum\n\n[![CI](https://github.com/sshaw/has_checksum/actions/workflows/ci.yml/badge.svg)](https://github.com/sshaw/has_checksum/actions/workflows/ci.yml)\n\nAutomatically calculate checksums and signatures from the values of your class' attributes/methods\n\nWorks with POROs and ActiveRecord.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem \"has_checksum\"\n```\n\nAnd then execute:\n\n    bundle\n\nOr install it yourself as:\n\n    gem install has_checksum\n\n## Usage\n\nUse the [`has_checksum`](#has_checksum) and/or [`has_signature`](#has_signature) class methods to calculate checksums or signatures of your class' columns and/or methods' return values.\n\n### `has_checksum`\n\n```rb\nclass User\n  include HasChecksum\n\n  attr_accessor :username\n\n  has_checksum :username\nend\n\nuser = User.new\nuser.username = \"sshaw\"\nuser.username_checksum # 5b891e901f3c8859115dcdfe323944ec7b4abbde9f7b680430fca7d2c7af89e5\n```\n\nBy default SHA256 is used.\n\nMultiple attributes can be specified:\n\n```rb\nclass User\n  include HasChecksum\n\n  attr_accessor :username\n  attr_accessor :updated_at\n\n  has_checksum :username, :updated_at\nend\n\nuser = User.new\nuser.username = \"sshaw\"\nuser.updated_at = Time.now\nuser.username_updated_at_checksum # bf6bfb33a4927184eae61195afcff0b033b13da15d79629d513639717c06e15f\n```\n\nUse the`:method` and `:algorithm` arguments to change the method name and algorithm. Here we use an ActiveRecord subclass:\n\n```rb\nclass User \u003c ActiveRecord::Base\n  include HasChecksum\n\n  has_checksum :settings, :updated_at, :method =\u003e \"settings_signature\", :algorithm =\u003e \"md5\"\nend\n\nuser.settings[:timezone] = \"America/Los_Angeles\"\nuser.save!\nuser.settings_signature # 4a390b8df412ab4168b9856291437bba\n```\n\nWith ActiveRecord, if the generated method is a database column, the checksum will be persisted:\n\n```\nrails g migration add_settings_signature_to_users settings_signature:string  # should use char(N), really\n```\n\n`:algorithm` can also be a block:\n\n```rb\nclass User \u003c ActiveRecord::Base\n  include HasChecksum\n\n  has_checksum :settings, :updated_at, :algorithm =\u003e -\u003e(value) { whirlpool(value) }\nend\n```\n\nBy default the checksum will be hex encoded but you can change this via `:encode`:\n\n```rb\nclass User \u003c ActiveRecord::Base\n  include HasChecksum\n\n  has_checksum :settings, :updated_at, :encode =\u003e \"base64\"  # or \"binary\" or \"bubblebabble\"\nend\n```\n\n### `has_signature`\n\nCalculates a hash-based message authentication code (HMAC).\nThis (mostly) works the same as [`has_checksum`](#has_checksum) but requires a `:key` argument that will be used as the HMAC's key:\n\n```rb\nclass User \u003c ActiveRecord::Base\n  include HasChecksum\n\n  has_signature :id, :created_at, :last_login_at, :key =\u003e :some_salt_column, :method =\u003e \"session_id\"\nend\n```\n\nIf `:key` is a `Symbol` it will treated as a method name. If it's a `String` is will be used literally, as the key.\nIt can also be a `Proc` that returns the key.\n\n## See Also\n\n[rspec-checksum-matchers](https://gist.github.com/sshaw/df14f6f89860b2dbcfd2)\n\n## Author\n\nSkye Shaw (skye.shaw -AT- gmail)\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsshaw%2Fhas_checksum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsshaw%2Fhas_checksum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsshaw%2Fhas_checksum/lists"}