Skip to content

change Hash (and RawValue) hex-string representation to show the least-significant field element as big-endian hex string#338

Merged
arnaucube merged 2 commits intomainfrom
hash-fmt-lsb
Jul 14, 2025
Merged

change Hash (and RawValue) hex-string representation to show the least-significant field element as big-endian hex string#338
arnaucube merged 2 commits intomainfrom
hash-fmt-lsb

Conversation

@arnaucube
Copy link
Collaborator

The motivation is that since some commits ago, the hex representation was changed from little-endian to big-endian, and when cropping the long strings of hex (hex representation of byte-arrays), the small values (224 bits or less) were being represented by 0x00000000..., which is indistinguishable from the 0 value.
This commit updates this cropped representation to print the last characters of the string (the less signifcant bytes of the big-endian representation), so that for example for the integer 5 the representation would be 0x...00000005.

More context at #337.

…t-significant field element as big-endian hex string

The motivation is that since some commits ago, the hex representation
was changed from little-endian to big-endian, and when cropping the long
strings of hex (hex representation of byte-arrays), the small values
(224 bits or less) were being represented by `0x00000000...`, which is
indistinguishable from the `0` value.
This commit updates this cropped representation to print the last
characters of the string (the less signifcant bytes of the big-endian
representation), so that for example for the integer `5` the
representation would be `0x...00000005`.
@arnaucube arnaucube requested a review from ed255 July 11, 2025 15:42
Copy link
Collaborator

@ed255 ed255 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left a few nitpicks but otherwise LGTM!

@arnaucube arnaucube merged commit 06b84e8 into main Jul 14, 2025
6 checks passed
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.

2 participants