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

Not working with Node v13 (Buffer with odd number of bytes) #17

Closed
oborodkin opened this issue Nov 5, 2019 · 1 comment · Fixed by #18
Closed

Not working with Node v13 (Buffer with odd number of bytes) #17

oborodkin opened this issue Nov 5, 2019 · 1 comment · Fixed by #18
Assignees

Comments

@oborodkin
Copy link

It seems like not working with Node v13. I get the error in example from doc:

TypeError [ERR_INVALID_ARG_VALUE]: The argument 'encoding' is invalid for data of length 11. Received 'hex'

But if I use for encrypting text with an even number of characters - it's ok.

Maybe is something changed in update method. If pass encrypted as string it will be ok. Buffer with odd number of bytes - error.

return decipher.update(encrypted.toString('hex'), 'hex', 'utf8') + decipher.final('utf8');

No error on v10.16.3, v12.8.0.

@MauriceButler
Copy link
Owner

Oh fun! 😞

Looks like this issue in node nodejs/node#29786

Ill keep an eye on it and see what can be done.

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 a pull request may close this issue.

2 participants