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 2 commits
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
12 changes: 6 additions & 6 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 @@ -2150,11 +2150,11 @@ added: v10.5.0
- `keylen` {number}
- `options` {Object}
- `N` {number} CPU/memory cost parameter. Must be a power of two greater
than one. **Default:** `16384`.
than one. **Default:** `16384`.
Copy link
Member

@tniessen tniessen Jun 26, 2018

Choose a reason for hiding this comment

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

Do we prefer this style @vsemozhetbyt? Seems like the current style causes issues when converted to HTML?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, the extra indentation produces false code blocks in HTML (not sure if this is per Markdown spec or just a quirk of marked we use in md-2-HTML conversion). See in the last nightly docs:

https://nodejs.org/download/nightly/v11.0.0-nightly201806268836a0d780/docs/api/crypto.html#crypto_crypto_scrypt_password_salt_keylen_options_callback

- `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`.
`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.

Sorry for not spotting this first time: it seems we lack the period between maxmem` and **Default:**. Can you add it since we are already here?)

Copy link
Author

@ghost ghost Jun 26, 2018

Choose a reason for hiding this comment

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

@vsemozhetbyt "it seems we lack the period between maxmem and **Default:**" What do you mean on "period" word? Could you please write an example?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for the ambiguity) I mean we need this fix:

maxmem`. **Default:**

Copy link
Author

Choose a reason for hiding this comment

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

I see. Sure.

- `callback` {Function}
- `err` {Error}
- `derivedKey` {Buffer}
Expand Down Expand Up @@ -2196,11 +2196,11 @@ added: v10.5.0
- `keylen` {number}
- `options` {Object}
- `N` {number} CPU/memory cost parameter. Must be a power of two greater
than one. **Default:** `16384`.
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`.
`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.

Ditto)

- Returns: {Buffer}

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