Browse Source

doc: clarify the behavior of Buffer.byteLength

PR-URL: https://github.com/nodejs/node/pull/11238
Refs: https://github.com/nodejs/node/issues/11165
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
v6
Nikolai Vavilov 8 years ago
committed by GitHub
parent
commit
271d50a892
  1. 4
      doc/api/buffer.md

4
doc/api/buffer.md

@ -618,6 +618,10 @@ Returns the actual byte length of a string. This is not the same as
[`String.prototype.length`] since that returns the number of *characters* in
a string.
*Note* that for `'base64'` and `'hex'`, this function assumes valid input. For
strings that contain non-Base64/Hex-encoded data (e.g. whitespace), the return
value might be greater than the length of a `Buffer` created from the string.
Example:
```js

Loading…
Cancel
Save