diff --git a/doc/api/buffer.md b/doc/api/buffer.md index 6f84a31d0f94d3..8311504c883d21 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -52,13 +52,16 @@ In versions of Node.js prior to v6, `Buffer` instances were created using the differently based on what arguments are provided: * Passing a number as the first argument to `Buffer()` (e.g. `new Buffer(10)`), - allocates a new `Buffer` object of the specified size. The memory allocated - for such `Buffer` instances is *not* initialized and *can contain sensitive - data*. Such `Buffer` instances *must* be initialized *manually* by using either - [`buf.fill(0)`][`buf.fill()`] or by writing to the `Buffer` completely. While - this behavior is *intentional* to improve performance, development experience - has demonstrated that a more explicit distinction is required between creating - a fast-but-uninitialized `Buffer` versus creating a slower-but-safer `Buffer`. + allocates a new `Buffer` object of the specified size. Prior to Node.js 8.0.0, + the memory allocated for such `Buffer` instances is *not* initialized and + *can contain sensitive data*. Such `Buffer` instances *must* be subsequently + initialized by using either [`buf.fill(0)`][`buf.fill()`] or by writing to the + `Buffer` completely. While this behavior is *intentional* to improve + performance, development experience has demonstrated that a more explicit + distinction is required between creating a fast-but-uninitialized `Buffer` + versus creating a slower-but-safer `Buffer`. Starting in Node.js 8.0.0, + `Buffer(num)` and `new Buffer(num)` will return a `Buffer` with initialized + memory. * Passing a string, array, or `Buffer` as the first argument copies the passed object's data into the `Buffer`. * Passing an [`ArrayBuffer`] returns a `Buffer` that shares allocated memory with @@ -427,6 +430,9 @@ console.log(buf2.toString());