feat: Added MD5 hashing algorithm#1519
feat: Added MD5 hashing algorithm#1519raklaptudirm merged 16 commits intoTheAlgorithms:masterfrom ManpreetXSingh:md5
Conversation
appgurueu
left a comment
There was a problem hiding this comment.
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, |
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, |
|
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! |
Describe your change:
Checklist:
Example:
UserProfile.jsis allowed butuserprofile.js,Userprofile.js,user-Profile.js,userProfile.jsare notFixes: #{$ISSUE_NO}.