Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAntoine du Hamel <duhamelantoine1995@gmail.com>2022-04-20 01:46:37 +0300
committerGitHub <noreply@github.com>2022-04-20 01:46:37 +0300
commit1e761654d3d93e4568d1228b92d1f3a09e92d078 (patch)
treeb003499fede78612e88e01c82f591b7d7ae503bd /lib
parent51fd5db4c18da2685b3825fb5617f7f968859299 (diff)
doc: consolidate use of multiple-byte units
Refs: https://en.wikipedia.org/wiki/Byte#Multiple-byte_units PR-URL: https://github.com/nodejs/node/pull/42587 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/assert.js2
-rw-r--r--lib/fs.js2
-rw-r--r--lib/internal/crypto/scrypt.js2
-rw-r--r--lib/internal/errors.js2
-rw-r--r--lib/internal/fs/utils.js2
5 files changed, 5 insertions, 5 deletions
diff --git a/lib/assert.js b/lib/assert.js
index bbd3c283c5f..2c7cf369a87 100644
--- a/lib/assert.js
+++ b/lib/assert.js
@@ -213,7 +213,7 @@ function getCode(fd, line, column) {
let lines = 0;
// Prevent blocking the event loop by limiting the maximum amount of
// data that may be read.
- let maxReads = 32; // bytesPerRead * maxReads = 512 kb
+ let maxReads = 32; // bytesPerRead * maxReads = 512 KiB
const bytesPerRead = 16384;
// Use a single buffer up front that is reused until the call site is found.
let buffer = Buffer.allocUnsafe(bytesPerRead);
diff --git a/lib/fs.js b/lib/fs.js
index 405c206d566..7b10c3d9f43 100644
--- a/lib/fs.js
+++ b/lib/fs.js
@@ -2879,7 +2879,7 @@ function lazyLoadStreams() {
/**
* Creates a readable stream with a default `highWaterMark`
- * of 64 kb.
+ * of 64 KiB.
* @param {string | Buffer | URL} path
* @param {string | {
* flags?: string;
diff --git a/lib/internal/crypto/scrypt.js b/lib/internal/crypto/scrypt.js
index 0d0ac1f7261..a36fb6dfba5 100644
--- a/lib/internal/crypto/scrypt.js
+++ b/lib/internal/crypto/scrypt.js
@@ -41,7 +41,7 @@ const defaults = {
N: 16384,
r: 8,
p: 1,
- maxmem: 32 << 20, // 32 MB, matches SCRYPT_MAX_MEM.
+ maxmem: 32 << 20, // 32 MiB, matches SCRYPT_MAX_MEM.
};
function scrypt(password, salt, keylen, options, callback = defaults) {
diff --git a/lib/internal/errors.js b/lib/internal/errors.js
index 434576bde16..1dfa36e5f36 100644
--- a/lib/internal/errors.js
+++ b/lib/internal/errors.js
@@ -1004,7 +1004,7 @@ E('ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY',
'Cannot overwrite symlink in subdirectory of self', SystemError);
E('ERR_FS_CP_UNKNOWN', 'Cannot copy an unknown file type', SystemError);
E('ERR_FS_EISDIR', 'Path is a directory', SystemError);
-E('ERR_FS_FILE_TOO_LARGE', 'File size (%s) is greater than 2 GB', RangeError);
+E('ERR_FS_FILE_TOO_LARGE', 'File size (%s) is greater than 2 GiB', RangeError);
E('ERR_FS_INVALID_SYMLINK_TYPE',
'Symlink type must be one of "dir", "file", or "junction". Received "%s"',
Error); // Switch to TypeError. The current implementation does not seem right
diff --git a/lib/internal/fs/utils.js b/lib/internal/fs/utils.js
index 61670011372..e570b42da88 100644
--- a/lib/internal/fs/utils.js
+++ b/lib/internal/fs/utils.js
@@ -122,7 +122,7 @@ const kMaximumCopyMode = COPYFILE_EXCL |
COPYFILE_FICLONE |
COPYFILE_FICLONE_FORCE;
-// Most platforms don't allow reads or writes >= 2 GB.
+// Most platforms don't allow reads or writes >= 2 GiB.
// See https://github.com/libuv/libuv/pull/1501.
const kIoMaxLength = 2 ** 31 - 1;