{"id":18244277,"url":"https://github.com/stackb/protoreflecthash","last_synced_at":"2025-04-08T18:33:28.517Z","repository":{"id":176690024,"uuid":"655926302","full_name":"stackb/protoreflecthash","owner":"stackb","description":"Reimplementation of https://github.com/deepmind/objecthash-proto for V2 protobuf API","archived":false,"fork":false,"pushed_at":"2023-06-22T20:48:51.000Z","size":187,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-14T14:51:41.643Z","etag":null,"topics":["object-hash","protobuf"],"latest_commit_sha":null,"homepage":"","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/stackb.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-19T23:06:49.000Z","updated_at":"2024-01-19T16:43:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"ca6791ef-70c0-4a39-8765-5f7fbd7ce00b","html_url":"https://github.com/stackb/protoreflecthash","commit_stats":null,"previous_names":["stackb/protoreflecthash"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackb%2Fprotoreflecthash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackb%2Fprotoreflecthash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackb%2Fprotoreflecthash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackb%2Fprotoreflecthash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackb","download_url":"https://codeload.github.com/stackb/protoreflecthash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247902308,"owners_count":21015426,"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":["object-hash","protobuf"],"created_at":"2024-11-05T09:15:59.532Z","updated_at":"2025-04-08T18:33:28.502Z","avatar_url":"https://github.com/stackb.png","language":"Go","readme":"[![CI](https://github.com/stackb/protoreflecthash/actions/workflows/ci.yaml/badge.svg)](https://github.com/stackb/protoreflecthash/actions/workflows/ci.yaml)\n\n\u003ctable border=\"0\"\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cimg src=\"https://user-images.githubusercontent.com/50580/141900696-bfb2d42d-5d2c-46f8-bd9f-06515969f6a2.png\" height=\"120\"/\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"https://camo.githubusercontent.com/e71e893edbc4626f5c28acde484c375e96109e64b835db9b60946ff092a7a87b/68747470733a2f2f6769746c61622e636f6d2f6d30336765656b2f6e6f64652d6f626a6563742d686173682f7261772f6d61737465722f6c6f676f2e737667\" height=\"120\"/\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eprotobuf\u003c/td\u003e\n    \u003ctd\u003eobjecthash\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n# protoreflecthash\n\nprotoreflecthash is a re-implementation of\n\u003chttps://github.com/deepmind/objecthash-proto\u003e.  That repo is now archived and\nwas never updated for [protobuf-apiv2](https://go.dev/blog/protobuf-apiv2).\n\n# Usage\n\n```\ngo get github.com/stackb/protoreflecthash@latest\n```\n\n```go\npackage main\n\nimport (\n    \"github.com/stackb/protoreflecthash\"\n)\n\nfunc main() {\n    msg := mustGetProtoMessageSomewhere()\n\n    options := []protoreflect.Option{\n      // protoreflect.MessageFullnameIdentifier(),\n      // protoreflect.FieldNamesAsKeys(),\n    }\n    hasher := protoreflect.NewHasher(options...)\n\n    hash, err := hasher.HashProto(msg.ProtoReflect())\n    if err != nil {\n        panic(err.Error())\n    }\n\n    fmt.Printf(\"%x\\n\", hash)\n}\n```\n\n# Background\n\n`protoreflecthash` computes the hash value for a protobuf message by taking a\nsha256 of the sum the individual component hashes of the message.  Special care\nis taken to account for various semantics of the protobuf format.\n\nThis implementation passes all functional unit tests from the original library\n[deepmind/objecthash-proto](https://github.com/deepmind/objecthash-proto)\n(excluding badness detection).\n\nOpen questions remain about the handling of protobufs with extension fields and\nthe google.protobuf.Any type.\n\nThis package is currently experimental; hash values for messages may change\nwithout warning until v1.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackb%2Fprotoreflecthash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackb%2Fprotoreflecthash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackb%2Fprotoreflecthash/lists"}