Jump to content
  • Advertisement
Sign in to follow this  
jeff8j

MD5 update any size?

This topic is 2495 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Im using c++ but asking the question in general. In my understanding hashes are updated via a specific chuck size. If i have a md5 implementation and call it first with a then b then c then finalize it would that be different than calling update with abc all at once then finalize?

I understand its a vague question that probably depends on the md5 implementation but in general let say im making a implementation my self would I have to make some kind of buffer to only update with a certain chunk size?

note: dont worry im not making a implementation just worried about the outcome and what I should be looking for im thinking of using crypto++ but not sure yet.

I said chunk from looking around I guess I could mean block. Edited by jeff8j

Share this post


Link to post
Share on other sites
Advertisement
Attempting to answer my own question I made this little php script.

It prints the same for both
so I guess my next thing todo is to make a c++ program that works like this
but still im not sure if the implementation has a buffer in it or not


$ctx = hash_init('md5');
hash_update($ctx, 'a');
hash_update($ctx, 'b');
hash_update($ctx, 'c');
echo hash_final($ctx);

echo '<br>';

$ctx = hash_init('md5');
hash_update($ctx, 'abc');
echo hash_final($ctx);

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!