Anonymous user
MD5: Difference between revisions
Updated D versions
m (whitespace) |
(Updated D versions) |
||
Line 333:
=={{header|D}}==
<lang d>import std.stdio, std.md5;
void main() {
ubyte[16] digest;
auto txt = "The quick brown fox jumped over the lazy dog's back";
sum(digest, txt);
writeln(digest.digestToString());
}</lang>
Output:
<pre>E38CA1D920C4B8B8D3946B2C72F01680</pre>
Alternative version:
{{libheader|Tango}}
<lang d>
void main(char[][] args) {
auto md5 = new Md5()
for(int i = 1
md5.update(args[i])
Stdout.formatln("[{}]=>\n[{}]", args[i], md5.hexDigest())
}
}</lang>
Output:
<pre>>md5test "The quick brown fox jumped over the lazy dog's back"
[The quick brown fox jumped over the lazy dog's back]=>
|