-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
sha1: Updated documentation #10374
sha1: Updated documentation #10374
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.
Some minor changes to do and we can merge this.
lib/std/sha1.nim
Outdated
result = "" | ||
for v in Sha1Digest(self): | ||
result.add(toHex(int(v), 2)) | ||
|
||
proc parseSecureHash*(hash: string): SecureHash = | ||
## Converts a string to a SecureHash |
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 never used this module, so at first I had hard time understanding the difference between this proc and secureHash
— both seem to convert string
to SecureHash
.
Maybe it would be better/clearer to have here "Converts a string hash to a SecureHash
"?
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.
Yes, I do agree - much clearer. I have also used backticks on the other instances of SecureHash
.
lib/std/sha1.nim
Outdated
@@ -170,23 +195,46 @@ proc finalize(ctx: var Sha1State): Sha1Digest = | |||
# Public API | |||
|
|||
proc secureHash*(str: string): SecureHash = | |||
## Generates a SecureHash from a string and returns it. |
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 would have either "Generates and returns a SecureHash
from a string str
", or remove "returns" completely: "Generates a SecureHash
from a string str
"
I'll repeat a comment from uri
:
General remark: I would love to see "See also:" section which will give links to similar procs. Some examples: strutils.indent, tables.getOrDefault, etc.
Here, specifically, a link to secureHashFile
and parseSecureHash
would be useful. (And vice-versa)
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.
Text updated in dac416a
Links updated in 331550f
I think I'm coming to terms with the internal linking 😄 . Give me a second to update PR #10372 for algorithm, so I can add some more links. I'm glad for the review comments and to be able to contribute in some way, but please let me know, if this review process takes too much of your time instead of doing it yourself.
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.
but please let me know, if this review process takes too much of your time instead of doing it yourself.
I have plenty of documentation I need to work on my own, so doing some reviews is a welcome change :)
So it is better for me this way (and more rewarding to you :)), and I'm sure as the time goes by this will take both us less time.
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.
Thank you - and I'm also convinced of that ;)
Updated documentation for sha1 module:
refs #10330
CC @narimiran