MD5: Difference between revisions

Content added Content deleted
No edit summary
(Added Wren)
Line 2,856: Line 2,856:
<pre>
<pre>
AF397EA30996B22759740AC66452D47A
AF397EA30996B22759740AC66452D47A
</pre>

=={{header|Wren}}==
{{libheader|Wren-fmt}}
This script uses the implementation from the [[MD5/Implementation#Wren]] task to process the Wikipedia examples. To import the former copy it (without the examples) to a file called 'md5.wren' in the same directory as this script.
<lang ecmascript>import "/md5" for md5
import "/fmt" for Fmt

var strings = [
"The quick brown fox jumps over the lazy dog",
"The quick brown fox jumps over the lazy dog.",
""
]

for (s in strings) {
var digest = md5.call(s)
Fmt.print("$s <== '$0s'", Fmt.v("xz", 2, digest, 0, "", ""), s)
}</lang>

{{out}}
<pre>
9e107d9d372bb6826bd81d3542a419d6 <== 'The quick brown fox jumps over the lazy dog'
e4d909c290d0fb1ca068ffaddf22cbd0 <== 'The quick brown fox jumps over the lazy dog.'
d41d8cd98f00b204e9800998ecf8427e <== ''
</pre>
</pre>