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

doc: clarify documentation in crypto #16229

Closed
wants to merge 2 commits into from

Conversation

jieyanhuang
Copy link
Contributor

Clarify on the return values for crypto.publicEncrypt and similar functions

Fixes: #12946

Checklist
Affected core subsystem(s)
  • doc

Clarify on the return values for crypto.publicEncrypt and similar
functions

Fixes: nodejs#12946
@nodejs-github-bot nodejs-github-bot added crypto Issues and PRs related to the crypto subsystem. doc Issues and PRs related to the documentations. labels Oct 16, 2017
@@ -1687,12 +1687,15 @@ added: v0.11.14
`crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING`,
`RSA_PKCS1_PADDING`, or `crypto.constants.RSA_PKCS1_OAEP_PADDING`.
- `buffer` {Buffer | TypedArray | DataView}
- Returns: {Buffer}
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can just put the description on the list?

- Returns: {Buffer} A new `Buffer` with the decrypted content.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right. I was taking reference from https://github.com/nodejs/node/blob/master/doc/api/buffer.md#bufequalsotherbuffer, where we specify a return type in the list and additional description in the later paragraph.

I realised this is actually a little inconsistent, the next function is documented as you have suggested above. I'll add a commit to clean this up, and implement your suggestion.

@gireeshpunathil
Copy link
Member

@lance
Copy link
Member

lance commented Oct 16, 2017

CI looks fine modulo a couple of known-to-be-flakey tests.

@lance lance self-assigned this Oct 16, 2017
@lance
Copy link
Member

lance commented Oct 16, 2017

Landed in a3a1068

Thanks for the contribution! 🥇

@lance lance closed this Oct 16, 2017
lance pushed a commit that referenced this pull request Oct 16, 2017
Clarify return values for crypto.publicEncrypt and similar functions

PR-URL: #16229
Fixes: #12946
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
targos pushed a commit that referenced this pull request Oct 18, 2017
Clarify return values for crypto.publicEncrypt and similar functions

PR-URL: #16229
Fixes: #12946
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
addaleax pushed a commit to ayojs/ayo that referenced this pull request Oct 18, 2017
Clarify return values for crypto.publicEncrypt and similar functions

PR-URL: nodejs/node#16229
Fixes: nodejs/node#12946
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
@MylesBorins
Copy link
Contributor

Should this be backported to v6.x-staging? If yes please follow the guide and raise a backport PR, if not let me know or add the dont-land-on label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crypto Issues and PRs related to the crypto subsystem. doc Issues and PRs related to the documentations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crypto docs don't explain the function signatures
9 participants