suve

awful: function: md2

Available since rev.36 (v.0.5.0).

Declaration

ascii :md2 ( string $MESSAGE , bool $RAW )
ascii :md2 ( string $MESSAGE )

Summary

Returns a string containing the MD2 checksum of MESSAGE. If RAW is specified and true, the result will be raw binary data. Otherwise, a hexadecimal representation is returned.

Example

# :md2 example
:hex-case s'lower'
:set &hash s'03d85a0d629d2c442e987525319fc471'
:set &calc :md2 s'The quick brown fox jumps over the lazy dog'

!if :eq $calc $hash
    :writeln s'MD2 calculation in awful seems to work fine.'
!else
    :writeln s"lolwut? awful's MD2 function is broken!"
!fi

wikipage modified on 2014/0601/2317