-
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: correctly reference where to list hash algorithms. #9043
Conversation
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.
Needs a few cleanups
Creates and returns a `Sign` object that uses the given `algorithm`. On | ||
recent OpenSSL releases, `openssl list-public-key-algorithms` will | ||
display the available signing algorithms. One example is `'RSA-SHA256'`. | ||
Creates and returns a `Sign` object that uses the given `algorithm`. For available signing algorithms, please reference `crypto.getHashes()`. |
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.
Nit: line wrap at 80 chars please :-)
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.
If we go with this approach, it would be best to make crypto.getHashes()
a link to the right location.
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.
Will get on this, thanks for the feedback
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.
Using reference
makes it sound like you should refer to the documentation for crypto.getHashes()
but what is really meant is to run it to obtain the array of available algorithms, right? If so, instead of this:
For available signing algorithms, please reference
crypto.getHashes()
.
...I'd prefer something like:
Use [
crypto.getHashes()
][] to obtain an array of names of the available signing algorithms.
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.
@jasnell for linking to crypto.getHashes()
would you reccomend putting a <a id="getHashes"></a>
above crypto.getHashes()
in the markdown, or do you have another preferred method?
Thanks
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.
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.
@sstern6 Some more info: That linking style is used throughout the doc and all (or nearly all) our other API docs. You can read about it at https://daringfireball.net/projects/markdown/syntax#link if you search for implicit link name shortcut
.
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.
thanks @Trott getting to that now. The link is already declared at the bottom of the page.
Updating the PR with all of the comments
@@ -1320,7 +1316,7 @@ console.log(alice_secret == bob_secret); | |||
added: v0.9.3 | |||
--> | |||
|
|||
Returns an array with the names of the supported hash algorithms. | |||
Returns an array with the names of the supported hash algorithms. For example, `RSA-SHA256`. |
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 added text is a sentence fragment (which is fine for the first "sentence", but subsequent statements should be complete sentences). It seems unnecessary anyway. If we do want to include the example, I'd prefer:
Returns an array with the names of the supported hash algorithms, such as
RSA-SHA256
.
Creates and returns a `Sign` object that uses the given `algorithm`. On | ||
recent OpenSSL releases, `openssl list-public-key-algorithms` will | ||
display the available signing algorithms. One example is `'RSA-SHA256'`. | ||
Creates and returns a `Sign` object that uses the given `algorithm`. For available signing algorithms, please reference `crypto.getHashes()`. |
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.
Using reference
makes it sound like you should refer to the documentation for crypto.getHashes()
but what is really meant is to run it to obtain the array of available algorithms, right? If so, instead of this:
For available signing algorithms, please reference
crypto.getHashes()
.
...I'd prefer something like:
Use [
crypto.getHashes()
][] to obtain an array of names of the available signing algorithms.
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.
LGTM with nits addressed.
@sstern6 can you please adjust the commit message to make it follow the guidelines? Thank you. |
Thanks everyone, will have all of these addressed by end of day. |
287e57d
to
09162f8
Compare
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.
LGTM
@@ -1320,7 +1320,8 @@ console.log(alice_secret == bob_secret); | |||
added: v0.9.3 | |||
--> | |||
|
|||
Returns an array with the names of the supported hash algorithms. | |||
Returns an array with the names of the supported hash algorithms, |
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.
Micro-nit: array with the names
-> array of the names
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.
@Trott updated
@Trott will have the micronit fixed by 4:30pst today. Thanks |
PR-URL: #9043 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Landed in 3d294cf. Thank you! |
PR-URL: #9043 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
PR-URL: #9043 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
PR-URL: #9043 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Checklist
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
Docs.
Description of change
Fixes Issue: #9005.
Update crypto docs by removing inaccurate command explanation from
crypto.createSign(algorithm)
andcrypto.createVerify(algorithm)
,accurately referencing how to get available hash algorithms from
crypto.getHashes()
.