digest

This is a convenience function to calculate a hash using the template API. Every digest passing the isDigest test can be used with this function.

  1. DigestType!Hash digest(Range range)
    digest
    (
    Hash
    Range
    )
    (
    auto ref Range range
    )
    if (
    !isArray!Range &&
    isDigestibleRange!Range
    )
  2. DigestType!Hash digest(T data)

Parameters

range Range

an InputRange with ElementType ubyte, ubyte[] or ubyte[num]

Examples

import std.digest.md;
import std.range : repeat;
auto testRange = repeat!ubyte(cast(ubyte)'a', 100);
auto md5 = digest!MD5(testRange);

Meta