Skip to content

Hex string representation of small digest values should have leading zeros #214

Description

@Sword-Smith

Whenever we represent a digest as a hex string, we should encode it in a big-endian way to make small1 digest values have leading zeros.

The behavior of the functions to_hex, try_from_hex, and the Ord implementation should be consistent. The conversion to and from BigUint also needs to agree.

Note that we do not necessarily have to change the encoding of other values. I am only concerned with the hex string representation of Digest. e.g. BFieldElement or Digest is serialized is not of a concern, I think.

Footnotes

  1. Small is well-defined for Digest as it implements the Ord trait.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions