Re: [PATCH 02/17] midx: split `get_midx_checksum()` by adding `get_midx_hash()`
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Dec 9, 2025, 01:50 UTC
- Message-ID
- <aTeAUKrB89RM9p+i@nand.local>
- In-Reply-To
- <aTd+fxpflcLuJXDn@nand.local>
On Mon, Dec 08, 2025 at 08:42:23PM -0500, Taylor Blau wrote:
Show 14 quoted lines
> On Mon, Dec 08, 2025 at 07:25:05PM +0100, Patrick Steinhardt wrote: > > If I didn't have the context of this patch series I would be wondering > > what the actual difference between `get_midx_checksum()` and > > `get_midx_hash()` is. The way the functions are named seems to rather > > indicate that we talk about two different kinds of hashes, rather than > > two different ways to encode them. > > > > Would it maybe be preferable to call them `get_midx_checksum()` and > > `get_midx_checksum_hex()`? While at it, we could go even further and > > rename them to `midx_get_checksum()` and `midx_get_checksum_hex()` to > > conform to our modern best practices. > > Yeah, I think those are both reasonable suggestions; I'll apply those > locally, thanks!
Hmm. Upon further thinking, I wonder which function should be named which.
I think the _checksum() variant suggests that it returns the non-hex encoded form, while the _hex() variant suggests the opposite. Unfortunately, the latter is both more commonly used and more characters to type ;-).
I wonder if there are shorter names available. Perhaps midx_get_checksum() and midx_get_checksum_raw()?
Thanks, Taylor