Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(textual): Render long bytes hash #14275

Merged
merged 11 commits into from
Jan 5, 2023
Merged

feat(textual): Render long bytes hash #14275

merged 11 commits into from
Jan 5, 2023

Conversation

amaury1093
Copy link
Contributor

Description

Closes: #14206


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@amaury1093 amaury1093 marked this pull request as ready for review December 13, 2022 09:12
@amaury1093 amaury1093 requested a review from a team as a code owner December 13, 2022 09:12
@JimLarson
Copy link
Contributor

Another suggestion has come up that would apply to non-hashed binary data: break up the hex digits into groups of four, separated by spaces - for the same reason we break up numbers when we display them. Consider

SHA-256=5D8FCFEFA9AEEB711FB8ED1E4B7D5C8A9BAFA46E8E76E68AA18ADCE5A10DF6AB

versus

SHA-256=5D8F CFEF A9AE EB71 1FB8 ED1E 4B7D 5C8A 9BAF A46E 8E76 E68A A18A DCE5 A10D F6AB

@JimLarson
Copy link
Contributor

Other alternatives were considered but don't seem as good:

  • Convert hash to a seed phrase - more human-readable, but there don't seem to be standard, widespread utilities for generating them from arbitrary binary data. By contrast, there are several widespread utilities that generate SHA-256 hashes as hex strings.
  • Use ssh's "visual fingerprints" - a block of ascii art that represents hash data. The rendering is too big for a ledger screen.

@amaury1093
Copy link
Contributor Author

I'll update this PR to switch to add grouping by 4 characters as described in #14275 (comment)

Copy link
Contributor

@JeancarloBarrios JeancarloBarrios left a comment

Choose a reason for hiding this comment

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

LGTM!

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 3, 2023

[Cosmos SDK] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 5, 2023

[Cosmos SDK - Tx] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@amaury1093 amaury1093 enabled auto-merge (squash) January 5, 2023 15:56
@amaury1093 amaury1093 merged commit 958b4ad into main Jan 5, 2023
@amaury1093 amaury1093 deleted the am/14206-bytes-hash branch January 5, 2023 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Textual bytes value renderer: Sign over hash
5 participants