Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for crypto.md #21500

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions doc/api/crypto.md
Original file line number Diff line number Diff line change
Expand Up @@ -2065,10 +2065,10 @@ const a = new Uint32Array(10);
console.log(crypto.randomFillSync(a).toString('hex'));

const b = new Float64Array(10);
console.log(crypto.randomFillSync(a).toString('hex'));
console.log(crypto.randomFillSync(b).toString('hex'));

const c = new DataView(new ArrayBuffer(10));
console.log(crypto.randomFillSync(a).toString('hex'));
console.log(crypto.randomFillSync(c).toString('hex'));
```

### crypto.randomFill(buffer[, offset][, size], callback)
Expand Down Expand Up @@ -2149,12 +2149,10 @@ added: v10.5.0
- `salt` {string|Buffer|TypedArray}
- `keylen` {number}
- `options` {Object}
- `N` {number} CPU/memory cost parameter. Must be a power of two greater
than one. **Default:** `16384`.
- `N` {number} CPU/memory cost parameter. Must be a power of two greater than one. **Default:** `16384`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, wrap long lines at 80 characters or less. Just align with the first list item character, like this:

  - `N` {number} CPU/memory cost parameter. Must be a power of two greater than
    one. **Default:** `16384`.

- `r` {number} Block size parameter. **Default:** `8`.
- `p` {number} Parallelization parameter. **Default:** `1`.
- `maxmem` {number} Memory upper bound. It is an error when (approximately)
`128*N*r > maxmem` **Default:** `32 * 1024 * 1024`.
- `maxmem` {number} Memory upper bound. It is an error when (approximately) `128*N*r > maxmem` **Default:** `32 * 1024 * 1024`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same)

Copy link
Contributor

@vsemozhetbyt vsemozhetbyt Jun 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe `128*N*r -> `128 * N * r for better readability?

- `callback` {Function}
- `err` {Error}
- `derivedKey` {Buffer}
Expand Down Expand Up @@ -2195,12 +2193,10 @@ added: v10.5.0
- `salt` {string|Buffer|TypedArray}
- `keylen` {number}
- `options` {Object}
- `N` {number} CPU/memory cost parameter. Must be a power of two greater
than one. **Default:** `16384`.
- `N` {number} CPU/memory cost parameter. Must be a power of two greater than one. **Default:** `16384`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same re wrapping.

- `r` {number} Block size parameter. **Default:** `8`.
- `p` {number} Parallelization parameter. **Default:** `1`.
- `maxmem` {number} Memory upper bound. It is an error when (approximately)
`128*N*r > maxmem` **Default:** `32 * 1024 * 1024`.
- `maxmem` {number} Memory upper bound. It is an error when (approximately) `128*N*r > maxmem` **Default:** `32 * 1024 * 1024`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same re wrapping and spaces.

- Returns: {Buffer}

Provides a synchronous [scrypt][] implementation. Scrypt is a password-based
Expand Down