Skip to content

buffer: throw if string is not a valid HEX string

As it is, if an invalid HEX string is passed to Buffer constructor, it will only use the valid HEX values and ignore the rest. But, it also throws an error when the length of the string is odd in length. This patch throws an error if the string is not a valid HEX string.

Fixes: https://github.com/nodejs/node/issues/3770

cc @vkurchatkin @trevnorris @bnoordhuis

Merge request reports

Loading