4 kyu
Implementing SHA-1
Loading description...
Cryptography
Algorithms
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
I don't understand the purpose of the 'update' method (python).
Is this were the SHA1 padding/preprocessing is to take place?
Basically everything you need to do:
After calling the update(message) method, you update the variable inside the class. When digest() is called, you work with this previously saved variable. I checked, scripts of multiple calls to update() are not tested. For a single instance of a class, the update() method is called once. p.s. Judging by your code, you are on the right track.
Python fork with B4B's anticheat
The kata does not mention what should be done if the last chunk is more than 448 bits long
Do I remove the end bits or do I add a new chunk?
So for posterity, what you're supposed to do is pad the message with zeroes until
bitlen(message) == 448 (mod 512)
.This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
Actually, I'll merge and and see if anyone breaks it again.
this was fun & I learned a lot! nice kata
another one to do later, is it broken or is hashlib not allowed and just not mentioned in the description