-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Conversation
Clarify on the return values for crypto.publicEncrypt and similar functions Fixes: nodejs#12946
doc/api/crypto.md
Outdated
@@ -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} |
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.
Maybe we can just put the description on the list?
- Returns: {Buffer} A new `Buffer` with the decrypted content.
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.
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.
CI looks fine modulo a couple of known-to-be-flakey tests. |
Landed in a3a1068 Thanks for the contribution! 🥇 |
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]>
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]>
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]>
Should this be backported to |
Clarify on the return values for crypto.publicEncrypt and similar functions
Fixes: #12946
Checklist
Affected core subsystem(s)