hexDigest

This is a convenience function similar to digest, but it returns the string representation of the hash. Every digest passing the isDigest test can be used with this function.

  1. char[digestLength!(Hash) * 2] hexDigest(Range range)
    char[digestLength!(Hash) * 2]
    hexDigest
    (
    Hash
    Range
    )
    (
    ref Range range
    )
    if (
    !isArray!Range &&
    isDigestibleRange!Range
    )
  2. char[digestLength!(Hash) * 2] hexDigest(T data)

Parameters

order

the order in which the bytes are processed (see toHexString)

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);
assert(hexDigest!MD5(testRange) == "36A92CC94A9E0FA21F625F8BFB007ADF");

Meta