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

BREAKING(encoding/hex): remove encodedLen, encodeToString, decodedLen, decodeString, errInvalidByte, errLength #733

Merged
merged 8 commits into from
Jul 6, 2021

Conversation

zhangyuannie
Copy link
Contributor

As discussed in std-wg, the following functions has been removed or made private, their one-liners are listed for convenience:
encodedLen(num) -> num * 2
encodeToString(arr) -> new TextDecoder().decode(hex.encode(arr))
decodedLen(num) -> num / 2
decodeString(str) -> hex.decode(new TextEncoder().encode(str))
errInvalidByte
errLength

decode now throw a RangeError if the input has an odd length, a TypeError if the input contains an invalid byte.

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

Thank you @zhangyuannie, this looks good to me. Sorry for slow review!

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.

None yet

2 participants