Skip to content

Add support for 3.21.2 path hashes#5

Merged
zao merged 1 commit into
masterfrom
pr/fix-3.21.2-hashes
Jul 25, 2023
Merged

Add support for 3.21.2 path hashes#5
zao merged 1 commit into
masterfrom
pr/fix-3.21.2-hashes

Conversation

@zao

@zao zao commented Jul 25, 2023

Copy link
Copy Markdown
Owner

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.

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.
@zao zao merged commit 082d139 into master Jul 25, 2023
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