Add support for 3.21.2 path hashes#5
Merged
Merged
Conversation
In 3.21.2 the method to compute hashes for files and directories suddenly changed. Previously it was `FNV1A64` with lowercase paths for files and directories having trailing slashes removed. Both path types had a suffix of `++` appended while hashing. The new method is instead using `MurmurHash64A` for hashing with a seed of `0x1337b33f`. The old `++` suffix is gone and all paths (both for files and directories) are now lowercase. As the patch also transformed the path representation in the index file to be all lowercase this affects the case of filenames from the listing and filenames/patterns given on the command line. The program can detect whether a given set of game files are old or new based on the hash of the root directory in the path representation and selects algorithms and logic accordingly. If the program detects old datafiles it will go into a legacy mode with the old case-sensitive logic, otherwise all input and output will be lowercased. External programs interacting with `bun_extract_file` needs to take this into consideration.
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.
In 3.21.2 the method to compute hashes for files and directories suddenly changed. Previously it was
FNV1A64with lowercase paths for files and directories having trailing slashes removed. Both path types had a suffix of++appended while hashing.The new method is instead using
MurmurHash64Afor hashing with a seed of0x1337b33f. The old++suffix is gone and all paths (both for files and directories) are now lowercase.As the patch also transformed the path representation in the index file to be all lowercase this affects the case of filenames from the listing and filenames/patterns given on the command line.
The program can detect whether a given set of game files are old or new based on the hash of the root directory in the path representation and selects algorithms and logic accordingly.
If the program detects old datafiles it will go into a legacy mode with the old case-sensitive logic, otherwise all input and output will be lowercased.
External programs interacting with
bun_extract_fileneeds to take this into consideration.