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

toJSON to default to interoperable hex (length % 2) #164

Closed
wants to merge 2 commits into from

Conversation

dcousens
Copy link
Contributor

Thoughts?
This catches me out quite often and I always end up having to then roll in .toString(16, 2) rather than just letting toJSON work it.

@axic
Copy link
Contributor

axic commented May 23, 2017

Why is this called toJSON? JSON doesn't even support hex numbers, so it should be base-10 if we call it toJSON?

@dcousens
Copy link
Contributor Author

Great point. I assume it was so eventually a fromJSON would import hex only?

@dcousens
Copy link
Contributor Author

dcousens commented Nov 28, 2017

@indutny thoughts?
This shouldn't be a breaking change.

@indutny
Copy link
Owner

indutny commented Nov 28, 2017

This is definitely a breaking change, but it is time to do some. Let's land this and few other major PRs.

Copy link
Owner

@indutny indutny left a comment

Choose a reason for hiding this comment

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

LGTM

@indutny
Copy link
Owner

indutny commented Nov 29, 2017

Landed in a46d2e2, thank you!

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.

3 participants