Hi Folks,
I've come across a situation where I find an MD5 hash would be extremely usefull - seeing if 2 (or more) files are the same.
I figured it should be simple to find source code for this (and there is plenty here in the forums) BUT almost all of it uses assembly for speed.
I can apreciate this from an encrypton POV, BUT it makes it much harder for me to muddle through.
Speed isn't the issue for me(pe se), so I'm obviously going to translate a c version myself whilst referencing the awesome work that our resident gurus have already done.
While I've got my *current* problem solved, my questions for the gurus are:
(Based upon the Florent Heyworth version from pbcrypto)
Why break everything up into chunks? If I can load an entire file into a memory buffer, why can't I just feed that buffer? Is there something inherent in the algorithm limiting the input string size? Or is that related more to the particular implementation (CPU register sizes,etc)?
In that particular implementation, is there a reason why it seems as if you have to call 15 different fuctions just to get the final value?
Or is that again limited to the fact that the conversion was done in 2000?
Obviously I'm going to be translating without really understanding...
<sigh> in php you just go $somevar = md5(file($filename));
Btw - HIME looks great, it's just way overpowered for what I want. And since I have no need of anything else, I can't justify the $150 to get rid of the nag screen...
Thanks in advance,
JS
I've come across a situation where I find an MD5 hash would be extremely usefull - seeing if 2 (or more) files are the same.
I figured it should be simple to find source code for this (and there is plenty here in the forums) BUT almost all of it uses assembly for speed.
I can apreciate this from an encrypton POV, BUT it makes it much harder for me to muddle through.
Speed isn't the issue for me(pe se), so I'm obviously going to translate a c version myself whilst referencing the awesome work that our resident gurus have already done.
While I've got my *current* problem solved, my questions for the gurus are:
(Based upon the Florent Heyworth version from pbcrypto)
Why break everything up into chunks? If I can load an entire file into a memory buffer, why can't I just feed that buffer? Is there something inherent in the algorithm limiting the input string size? Or is that related more to the particular implementation (CPU register sizes,etc)?
In that particular implementation, is there a reason why it seems as if you have to call 15 different fuctions just to get the final value?
Or is that again limited to the fact that the conversion was done in 2000?
Obviously I'm going to be translating without really understanding...
<sigh> in php you just go $somevar = md5(file($filename));
Btw - HIME looks great, it's just way overpowered for what I want. And since I have no need of anything else, I can't justify the $150 to get rid of the nag screen...
Thanks in advance,
JS
Comment