public
Description: Calculate an MD5 digest in parts, saving and restoring the calculation
Homepage: http://idle-hacking.com/
Clone URL: git://github.com/taf2/md5-partial.git
Todd A. Fisher (author)
Mon Jun 29 14:18:08 -0700 2009
commit  4374072e61302f71388633fc8e5d2df9a5fba1e8
tree    36736ccb6caec2f5908bf388f2d4fddd72f10298
parent  a2c43fb7f8e911ceb7f5d725563cf4c24e31831d
name age message
file LICENSE Sun Jun 28 16:45:51 -0700 2009 add the license file generic stuff [Todd Fisher]
file README Sun Jun 28 16:45:40 -0700 2009 update README [Todd Fisher]
file Rakefile Sun Jun 28 12:36:05 -0700 2009 adding initial files [Todd A. Fisher]
directory ext/ Mon Jun 29 13:48:52 -0700 2009 remove unused variable [Todd A. Fisher]
file md5-partial.gemspec Mon Jun 29 13:49:08 -0700 2009 update version [Todd A. Fisher]
directory test/ Mon Jun 29 14:18:08 -0700 2009 little more output [Todd A. Fisher]
README
Make it possible to store a partial md5 calculation for later use. 
Have you ever received a very large file and wanted to calculate a checksum for the file to verify it's correctness?
You probably noticed it took a very long time to compute.  What if you could calculate the checksum as you received the 
file.
Okay you can do this with existing Digest::MD5, but what if you received a little bit of the file and stopped.  The 
process receiving
or server receiving the file stopped.  Then sometime later you are able to resume receiving the file. You don't want to 
have to start
recalculating the file from the beginning again, because lets say you already received 75% of the file. If it took a 
long time to compute
the MD5 for 100% of the file it will still take some time for 75% of the file.  MD5Partial allows you to save the 
computation to disk, or any
other storage so that you can continue from where ever you left off.

It has exactly the same interface as Digest::MD5, but adds 2 additional functions, save and restore.


Here's how it works, the MD5_CTX structure can be serialized to a string.  Once in string form it can be stored using 
any method you like...
file system, database, etc...

see test/test.rb for example usage