diff options
author | Nikolai Vavilov <vvnicholas@gmail.com> | 2017-02-09 20:47:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-09 20:47:48 +0200 |
commit | 271d50a8925de3cf479b2e523b59f4d0a62f450d (patch) | |
tree | 28f7dffbb46a90ca3afeffb725627089a6de6448 /doc/api/buffer.md | |
parent | 0700927832e167ac83183aefa0f63af02b6c3a75 (diff) | |
download | android-node-v8-271d50a8925de3cf479b2e523b59f4d0a62f450d.tar.gz android-node-v8-271d50a8925de3cf479b2e523b59f4d0a62f450d.tar.bz2 android-node-v8-271d50a8925de3cf479b2e523b59f4d0a62f450d.zip |
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>
Diffstat (limited to 'doc/api/buffer.md')
-rw-r--r-- | doc/api/buffer.md | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/doc/api/buffer.md b/doc/api/buffer.md index 5d39edbe13..51ea87687d 100644 --- a/doc/api/buffer.md +++ b/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 |