Repository navigation
feat: share the RomFS path hash between the reader and the writer - #6
Merged
Merged
Conversation
LNSD
force-pushed
the
lnsd/romfs-path-hash
branch
from
August 13, 2026 10:54
7c3176c to
7d76812
Compare
The hash and the chain terminator were private to the writer, so a reader outside this crate had to grow its own copy of arithmetic both sides must agree on exactly; `raw` is where the format's shared facts belong. - Add `raw::romfs::path_hash`, taking the name as bytes because that is how an image stores it, and `raw::romfs::NO_ENTRY` for the offset that ends every chain. - Point the writer's `calc_path_hash` and `ROMFS_ENTRY_EMPTY` at them, along with the reader's four bare `u32::MAX` comparisons. - Make `serde` optional under `filesystem-support`: only the NPDM builder derives it, so a `raw`-only consumer no longer drags it into a `no_std` build. - Pin `path_hash` with unit tests covering the seed, the parent's effect on the bucket, and a multi-byte name hashing one round per stored byte. Signed-off-by: Lorenzo Delgado <lnsdev@proton.me>
LNSD
force-pushed
the
lnsd/romfs-path-hash
branch
from
August 13, 2026 10:56
7d76812 to
6aeb119
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The hash and the chain terminator were private to the writer, so a reader outside this crate had to grow its own copy of arithmetic both sides must agree on exactly;
rawis where the format's shared facts belong.raw::romfs::path_hash, taking the name as bytes because that is how an image stores it, andraw::romfs::NO_ENTRYfor the offset that ends every chain.calc_path_hashandROMFS_ENTRY_EMPTYat them, along with the reader's four bareu32::MAXcomparisons.serdeoptional underfilesystem-support: only the NPDM builder derives it, so araw-only consumer no longer drags it into ano_stdbuild.path_hashwith unit tests covering the seed, the parent's effect on the bucket, and a multi-byte name hashing one round per stored byte.