std.digest.md

Computes MD5 hashes of arbitrary data. MD5 hashes are 16 byte quantities that are like a checksum or CRC, but are more robust.

This module conforms to the APIs defined in std.digest. To understand the differences between the template and the OOP API, see std.digest.

This module publicly imports std.digest and can be used as a stand-alone module.

License

Boost License 1.0.

CTFE: Digests do not work in CTFE

Authors

Piotr Szturmaj, Kai Nacke, Johannes Pfau

The routines and algorithms are derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm.

References:

Wikipedia on MD5

Source: std/digest/md.d

alias MD5Digest
struct MD5

Types 2

structMD5

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

Fields
uint[4] _state
ulong _count
ubyte[64] _buffer
ubyte[64] _padding
512 blockSize
Methods
uint F(uint x, uint y, uint z)
uint G(uint x, uint y, uint z)
uint H(uint x, uint y, uint z)
uint I(uint x, uint y, uint z)
void FF(ref uint a, uint b, uint c, uint d, uint x, uint s, uint ac) @safe pure nothrow @nogc
void GG(ref uint a, uint b, uint c, uint d, uint x, uint s, uint ac) @safe pure nothrow @nogc
void HH(ref uint a, uint b, uint c, uint d, uint x, uint s, uint ac) @safe pure nothrow @nogc
void II(ref uint a, uint b, uint c, uint d, uint x, uint s, uint ac) @safe pure nothrow @nogc
private void transform(const(ubyte[64]) * block) pure nothrow @nogc
void put(scope const(ubyte)[] data...) @trusted pure nothrow @nogcUse this to feed the digest with data. Also implements the isOutputRange interface for `ubyte` and `const(ubyte)[]`.
void start() @safe pure nothrow @nogcUsed to (re)initialize the MD5 digest.
ubyte[16] finish() @trusted pure nothrow @nogcReturns the finished MD5 hash. This also calls start to reset the internal state.

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

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

Functions 1

fnauto md5Of(T...)(T data)This is a convenience alias for digest using the MD5 implementation.