Skip to content

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

Closed
dcousens wants to merge 2 commits intomasterfrom
dcousens-patch-1
Closed

toJSON to default to interoperable hex (length % 2)#164
dcousens wants to merge 2 commits intomasterfrom
dcousens-patch-1

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