Skip to content

Evaluate Hex alias, Base16 default type-parameter ergonomics, and protocol docs #13

Open

Description

@tisonkun

Context

Omitting a bare Base16 alias prevents silent uppercase bugs when migrating hex::encode callers, because RFC 4648 Base16 is uppercase whereas Rust's hex ecosystem defaults to lowercase. Two small usability frictions remain: decode-only call sites written as Base16Lower::decode(input) read as if uppercase hex might be rejected even though decoding uses policy::Mixed, while importing bases::base16::Base16 directly requires <Base16>::decode(input) because Rust struct default type parameters do not apply in method/value paths (E0282). In addition, users implementing specs such as RFC 7515 (JWS) or RFC 5155 (DNSSEC NSEC3) benefit from direct mapping examples to existing profiles and policy combinations.

Considerations

  • Evaluate whether exporting pub type Hex = Base16Lower; (or keeping Base16Lower / Base16Upper as the only crate-root hex aliases) better serves downstream migrations from hex without reintroducing case ambiguity.
  • Document concise protocol-to-profile mappings in the usage guide and rustdoc (for example, RFC 7515 JWS -> Base64UrlUnpadded, RFC 5155 NSEC3 -> Base32<ExtendedHex, Unpadded, Lower, Mixed>, and case-insensitive hex decoding).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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