-
Notifications
You must be signed in to change notification settings - Fork 30k
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
doc: argument types for crypto methods #11799
Conversation
1e1f04e
to
8f1bea4
Compare
8f1bea4
to
887f799
Compare
doc/api/crypto.md
Outdated
@@ -62,6 +62,7 @@ const cert2 = crypto.Certificate(); | |||
<!-- YAML | |||
added: v0.11.8 | |||
--> | |||
- `spkac` {string | Buffer} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sentence below:
The `spkac` argument can be either a string
or a [`Buffer`][].
can be removed now.
Also, while you are at it, you can just add the return type here
* Returns {Buffer} The challenge component of the `spkac` data structure,
which includes a public key and a challenge.
and remove the whole paragragh
The `spkac` data structure includes a public key and a challenge. The
`certificate.exportChallenge()` returns the challenge component in the
form of a Node.js [`Buffer`][]. The `spkac` argument can be either a string
or a [`Buffer`][].
Doesn't need to happen in this PR though :D
doc/api/crypto.md
Outdated
@@ -80,6 +81,7 @@ console.log(challenge.toString('utf8')); | |||
<!-- YAML | |||
added: v0.11.8 | |||
--> | |||
- `spkac` {string | Buffer} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
doc/api/crypto.md
Outdated
@@ -80,6 +81,7 @@ console.log(challenge.toString('utf8')); | |||
<!-- YAML | |||
added: v0.11.8 | |||
--> | |||
- `spkac` {string | Buffer} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
doc/api/crypto.md
Outdated
@@ -98,6 +100,7 @@ console.log(publicKey); | |||
<!-- YAML | |||
added: v0.11.8 | |||
--> | |||
- `spkac` {Buffer} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
doc/api/crypto.md
Outdated
@@ -214,6 +219,7 @@ been completed using the [`cipher.final()`][] method. | |||
<!-- YAML | |||
added: v0.7.1 | |||
--> | |||
- `auto_padding` {boolean} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The auto_padding=true
part above can be modified to cipher.setAutoPadding([auto_padding])
if we make this item:
- `auto_padding` {boolean} Defaults to true.
doc/api/crypto.md
Outdated
@@ -372,6 +384,7 @@ Returns `this` for method chaining. | |||
<!-- YAML | |||
added: v0.7.1 | |||
--> | |||
- `auto_padding` {boolean} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
doc/api/crypto.md
Outdated
@@ -1599,6 +1682,8 @@ time is right after boot, when the whole system is still low on entropy. | |||
<!-- YAML | |||
added: v0.11.11 | |||
--> | |||
- `engine` {string} | |||
- `flags` {constant} Defaults to `crypto.constants.ENGINE_METHOD_ALL`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is {number}
... or {crypto.constants}
would be a bit clearer.
b22c732
to
0fbbc74
Compare
doc/api/crypto.md
Outdated
@@ -189,15 +186,15 @@ once will result in an error being thrown. | |||
<!-- YAML | |||
added: v1.0.0 | |||
--> | |||
- `buffer` {Buffer} | |||
- Returns {this} for method chaining. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the common format in docs is:
Returns: {Cipher}
0fbbc74
to
92d6668
Compare
Landed in 73e2d0b. Thank you! |
Refs: nodejs#9399 PR-URL: nodejs#11799 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This PR need backport to v7 |
Should this be backported to |
Checklist
Affected core subsystem(s)
documentation.
Description of changes
Adds argument data types to the docs for
crypto
methods.