Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic hashing #66

Open
wants to merge 44 commits into
base: main
Choose a base branch
from
Open

Dynamic hashing #66

wants to merge 44 commits into from

Conversation

mitschabaude
Copy link
Member

@mitschabaude mitschabaude commented Nov 5, 2024

continuing from #62, this expands the scope of dynamic-schema-friendly hashing,

  • make nested records work correctly (inner records are hashed dynamically as well)
  • hash dynamic arrays - in particular, strings - such that the hash only depends on the actual elements (not the padding)
  • hash primitive JS types (number, boolean, undefined, ...)
  • general-purpose hashDynamic() and packToField() methods that work basically on anything, in a way that is compatible with DynamicArray.hash() (for arrays / strings) and DynamicRecord.hash() (for objects)

mostly finishes #68

TODOs:

  • tests for complicated dynamic arrays
  • tests for subschemas of nested records
  • hash plain arrays such that it's compatible with dynamic arrays
  • assertEquals(), assertStrictlyEquals() for DynamicArray
  • easy and well-defined schema definition API
    • including generic strings, bytes and other arrays without specifying max size
    • left for next PR

@mitschabaude mitschabaude marked this pull request as ready for review November 7, 2024 13:41
Base automatically changed from feature/flexible-subschema to main November 7, 2024 19:29
@mitschabaude mitschabaude mentioned this pull request Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant