-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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
behaviour of Buffer.from(string[, encoding]) is not specified for invalid input #24722
Comments
See #3770 for rationale. Summary: the validation for 'hex' was only partial and inconsistently applied at that, so it was removed. For example, |
Forgot to mention, changing the current behavior might have backwards compatibility implications. Node.js has always* accepted * I'm fairly sure it goes back all the way to Node.js v0.1 or v0.2. |
This is kinda insane tbh. Can this breaking change be done in Node.js 18 then? |
There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment. For more information on how the project manages feature requests, please consult the feature request management document. |
There has been no activity on this feature request and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment. For more information on how the project manages feature requests, please consult the feature request management document. |
for example
In general Buffer.from returns trash if input string is is not valid, and it could be a source if error/bugs. in node v7 this it was throwing
TypeError: Invalid hex string
but now it isn't.v8.12.0
Darwin Iraklis-MacBook-Pro-2.local 18.0.0 Darwin Kernel Version 18.0.0: Wed Aug 22 20:13:40 PDT 2018; root:xnu-4903.201.2~1/RELEASE_X86_64 x86_64
Related to #8569 but it's not a feature request it's a bug report as I consider this to be a bug and instead of adding safeFrom this default one should be safe and if people need there should be
unsafeFrom
.The text was updated successfully, but these errors were encountered: