Skip to content

Specify standard SSSOM hashing algorithm - #534

Merged
gouttegd merged 10 commits into
masterfrom
add-hashing-function-fnv64
Apr 14, 2026
Merged

Specify standard SSSOM hashing algorithm#534
gouttegd merged 10 commits into
masterfrom
add-hashing-function-fnv64

Conversation

@gouttegd

@gouttegd gouttegd commented Apr 11, 2026

Copy link
Copy Markdown
Contributor

(This is an alternative to #529. The core proposition is the same, but the hashing procedure uses the FNV64 condensation function and hexadecimal encoding, rather than SHA2-256 and ZBase32 – as tentatively proposed in this comment.)

Resolves [#436]

  • docs/ have been added/updated if necessary
  • make test has been run locally
  • tests have been added/updated (if applicable)
  • CHANGELOG.md has been updated.

This PR adds a new section to the normative part of the website, intended for specifying stuff that are not part of the SSSOM data model nor of any of the SSSOM serialisation formats, but that should still be formally specified so that they can be implemented in the expected way by the various implementations.

The existing page about "chaining rules" is moved to that new section, as it does not really belong to the "data model".

Finally, the core of the PR is that a new page is added to the new section to define a standard SSSOM hashing function.

closes #436

gouttegd and others added 7 commits April 5, 2026 16:30
This commit adds a new section to the normative part of the website,
intended for specifying stuff that are not part of the SSSOM data model
nor of any of the SSSOM serialisation formats, but that should still be
formally specified so that they can be implemented in the expected way
by the various implementations.

The existing page about "chaining rules" is moved to that new section,
as it does not really belong to the "data model".

A new page is added to the new section to define a standard SSSOM
hashing function.

closes #436
Provide examples in SSSOM/TSV rather than JSON format. Add an example of
a mapping record making use of extension slots. Show for each example
the canonical S-expression in addition to the final hash value.
Add a table explaining how to turn the value of an extension slot into a
string, based on the declared type of the extension.
Run the following command:

  npx --yes prettier --check --prose-wrap always --tab-width 4 \
      --write src/docs/spec-support-hashing.md

Note the `--tab-width 4`! Without it, that piece of crap that is npx
prettier would completely mangle the nested lists.
This mostly turns my comment
(#529 (comment))
into a guidance page. Not convinced this is really useful, but that's
what has been asked in review.
@gouttegd
gouttegd requested review from cthoyt and matentzn April 11, 2026 15:49
@gouttegd gouttegd self-assigned this Apr 11, 2026
Change the specification of the proposed SSSOM hashing procedure so that
it uses the FNV64 hash function (RFC 9923) instead of SHA2-256. We
should not need the cryptographic properties of SHA2-256, and FNV64
yields smaller, more easily handled hash values which can then be
encoded in simple hexadecimal.
@gouttegd
gouttegd force-pushed the add-hashing-function-fnv64 branch from 463a518 to 2a8a8fc Compare April 14, 2026 08:52
cthoyt
cthoyt previously approved these changes Apr 14, 2026
matentzn
matentzn previously approved these changes Apr 14, 2026

@matentzn matentzn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incredibly thorough. And the discussion was a masterpiece of Open Data coordination. THANKS!

Comment thread src/docs/spec-intro.md Outdated
Comment thread src/docs/spec-support-hashing.md Outdated
@cthoyt

cthoyt commented Apr 14, 2026

Copy link
Copy Markdown
Member

confirming the FNV64 variant works in the sssom-pydantic implementation c.f. cthoyt/sssom-pydantic@5a2863c

Comment thread src/docs/spec-support-hashing.md Outdated
Comment thread src/docs/spec-support-hashing.md Outdated
@gouttegd
gouttegd force-pushed the add-hashing-function-fnv64 branch from 8590a8c to ebe5cb5 Compare April 14, 2026 12:35
Comment thread src/docs/spec-support-hashing.md Outdated
Comment thread src/docs/spec-support-hashing.md
Co-authored-by: Charles Tapley Hoyt <cthoyt@gmail.com>
@cthoyt cthoyt changed the title Add hashing function (FNV64 variant) Specify canonical hashing function Apr 14, 2026
@cthoyt cthoyt changed the title Specify canonical hashing function Specify standard SSSOM hashing function Apr 14, 2026
@cthoyt cthoyt changed the title Specify standard SSSOM hashing function Specify standard SSSOM hashing algorithm Apr 14, 2026
@cthoyt

cthoyt commented Apr 14, 2026

Copy link
Copy Markdown
Member

@gouttegd :shipit:

@gouttegd
gouttegd merged commit 8d18cf5 into master Apr 14, 2026
3 checks passed
@gouttegd
gouttegd deleted the add-hashing-function-fnv64 branch April 14, 2026 13:19
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.

Define a standard hashing procedure

3 participants