diff --git a/index.js b/index.js index 834bea0d..d5347f38 100644 --- a/index.js +++ b/index.js @@ -231,6 +231,9 @@ function fromString (that, string, encoding) { var actual = that.write(string, encoding) if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') that = that.slice(0, actual) }