square / square/wire

Deterministic Encoding and Hashing

Open
#1,939 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
4.4k
Forks
627
Avg merge
3d 15m
Merged PRs (30d)
20

Description

It would be really useful for proto objects to provide a deterministic hash so that it can be used for version checking/conflict detection etc.

We were recently using the HashCode() method but discovered that is not deterministic across processes because wire enums use the object reference as the hashcode.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the proto objects' HashCode() implementation and the wire enum hashing behavior mentioned in the issue. Determine the deterministic encoding and hashing contract needed for version checking or conflict detection, then verify that equal inputs produce the same result across processes.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.