View source code
Display the source code in std/digest/md.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

Alias std.digest.md.MD5Digest

OOP API MD5 implementation. See std.digest for differences between template and OOP API.

alias MD5Digest = std.digest.WrapperDigest!(std.digest.md.MD5);

This is an alias for std.digest.WrapperDigest!MD5, see there for more information.

Example

//Simple example, hashing a string using Digest.digest helper function
auto md5 = new MD5Digest();
ubyte[] hash = md5.digest("abc");
//Let's get a hash string
writeln(toHexString(hash)); // "900150983CD24FB0D6963F7D28E17F72"

Example

//Let's use the OOP features:
void test(Digest dig)
{
 dig.put(cast(ubyte) 0);
}
auto md5 = new MD5Digest();
test(md5);

//Let's use a custom buffer:
ubyte[16] buf;
ubyte[] result = md5.finish(buf[]);
writeln(toHexString(result)); // "93B885ADFE0DA089CDF634904FD59F71"

Authors

Piotr Szturmaj, Kai Nacke, Johannes Pfau
The routines and algorithms are derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm.

License

Boost License 1.0.