Next: mpz Prev: CRYPTOGRAPHIC EXTENSIONS Up: CRYPTOGRAPHIC EXTENSIONS Top: Top

7.1. Built-in module md5

This module implements the interface to RSA's MD5 message digest algorithm (see also the file md5.doc). It's use is very straightforward: use the function md5 to create an md5-object. You can now ``feed'' this object with arbitrary strings.

At any time you can ask the ``final'' digest of the object. Internally, a temorary copy of the object is made and the digest is computed and returned. Because of the copy, the digest operation is not desctructive for the object. Before a more exact description of the use, a small example: to obtain the digest of the string 'abc', use ...

More condensed:

md5 (arg) -- function of module md5
Create a new md5-object. arg is optional: if present, an initial update method is called with arg as argument.
An md5-object has the following methods:

update (arg) -- Method on md5
Update this md5-object with the string arg.
digest () -- Method on md5
Return the digest of this md5-object. Internally, a copy is made and the C-function MD5Final is called. Finally the digest is returned.
copy () -- Method on md5
Return a separate copy of this md5-object. An update to this copy won't affect the original object.