Re: [PATCH v2 1/6] pack-objects: add --full-name-hash option
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 19, 2024, 21:56 UTC
- Message-ID
- <xmqqh6ab5mvb.fsf@gitster.g>
- In-Reply-To
- <5f52e2617654946c87fff0744393b984ccaab043.1726692381.git.gitgitgadget@gmail.com>
"Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 10 quoted lines
> +static inline uint32_t pack_full_name_hash(const char *name)
> +{
> + const uint32_t bigp = 1234572167U;
> + uint32_t c, hash = bigp;
> +
> + if (!name)
> + return 0;
> +
> + /*
> + * Do the simplest thing that will resemble pseduo-randomness: add"pseduo" -> "pseudo"
> + * random multiples of a large prime number with a binary shift. > + * The goal is not to be cryptographic, but to be generally > + * uniformly distributed. > + */
Other than that, there is no substantial difference since the previous iteration; this step looks good.
Thanks.