-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
feat: Added MD5 hashing algorithm #1519
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
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.
The code is pretty messy because it juggles various representations of bytes that aren't really suitable (strings of bits encoded as ASCII 0 / 1 etc.)
It should be changed to just use Uint8Array
wherever byte arrays are needed, and simply numbers wherever 4 byte "words" are needed. The string representations (and the code for dealing with them) should be gotten rid of entirely.
Also needs tests.
Hi @appgurueu,
Thanks for the feedback!
Actually I'm quite new to the js world. I looked at the SHA implementations in the nearby files and assumed that it's the right way to do it. I'll try my best to fix the issues and make the code cleaner.
[...] I looked at the SHA implementations in the nearby files and assumed that it's the right way to do it. [...]
Ah, sorry about that. We have much legacy code lying around that needs to be refactored and definitely isn't a good example. We should make it more clear in the contribution guidelines that much of the legacy codebase shouldn't be taken as a good example.
The MD5 function now returns a uint8 array with the correct endianness.
Hi @appgurueu,
I believe I have implemented all of the requested changes. Please let me know if any additional adjustments are needed.
Adding the hacktoberfest-accepted label in case we don't get this merged before October ends; the PR is almost there!
Thanks! 😊
Thank you for your contribution!
Uh oh!
There was an error while loading. Please reload this page.
Open in Gitpod know more
Describe your change:
Checklist:
Example:
UserProfile.js
is allowed butuserprofile.js
,Userprofile.js
,user-Profile.js
,userProfile.js
are notFixes: #{$ISSUE_NO}
.