-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Buffer.from for the hex string #24491
Comments
Works as expected. 'hex' encodes one byte as two hex characters - one character is not a valid hex string. |
@nlapshin To expand a bit on the answer here – the issue is that there’s no way to tell which byte(s) you mean by the hex string If you need a way to convert numbers into If you have any more questions about this, https://github.com/nodejs/help might be a good place. |
Oh, thanks for the detailed response. I understood that hex string '5' or 'b' is one byte. And now, I understand, after your explantation, why 'Buffer.from' works that way. Thanks a lot! |
fixes: nodejs#29786 refs: nodejs#29792 refs: nodejs#24491
Days since last bug caused by this: 0 |
@nodejs/buffer Is there any support for a breaking change that throws rather than discards data in this situation? |
And if not, how about a warning? |
I'd be happy with a throw but we'd have to take the current behavior through a deprecation cycle first |
I use the conversion to the hexadecimal number buffer as follows
But, for number less that 16(15, 14 and so on) I get an empty buffer.
Example
The text was updated successfully, but these errors were encountered: