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

implement Display for u5 #89

Closed
wants to merge 1 commit into from

Conversation

tcharding
Copy link
Member

No reason not to enable printing u5s.

Fix: #80

@apoelstra
Copy link
Member

It looks like these are being displayed as decimal numbers. This is unexpected. They should be displayed as bech32 characters.

@tcharding
Copy link
Member Author

bech32 knows about u5 but u5 does not know about bech32; isn't u5 a stand alone type and hence its Display impl should behave like other standard integer types?

@tcharding
Copy link
Member Author

Review question unresolved but I rebased while thinking about it.

No reason not to enable printing u5s.

Fix: rust-bitcoin#80
@apoelstra
Copy link
Member

apoelstra commented Mar 6, 2023

I think of u5 as a field element in GF32, definitely not as a standalone integer type. We could rename it if this is confusing.

Do we have Add and Mul implemented on this type, and do they respect field operations or "mod 32" operatons?

To be clearer: this crate has no use for integers mod 32, and I can't think of any crate that does.

@tcharding
Copy link
Member Author

Closing this, see #94

@tcharding tcharding closed this Mar 22, 2023
@tcharding tcharding deleted the 03-03-u8-display branch May 16, 2023 23:31
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.

u5 does not implement Display
2 participants