Module description

md5 -- MD5 Message Digest Algorithm
The md5 module implements the MD5 algorithm.

MD5 Structure

md5% ( -- n )
Get the required space for a md5 variable

MD5 variable creation, initialisation and destruction

md5-init ( md5 -- )
Initialise the MD5 variable
md5-create ( "<spaces>name" -- ; -- md5 )
Create a named MD5 variable in the dictionary
md5-new ( -- md5 )
Create a new MD5 variable on the heap
md5-free ( md5 -- )
Free the MD5 variable from the heap

MD5 words

md5-reset ( md5 -- )
Reset the MD5 state
md5-update ( c-addr u md5 -- )
Update the MD5 with more data c-addr u
md5-finish ( md5 -- u1 u2 u3 u4 )
Finish the MD5 calculation, return the result u1 u2 u3 u4
md5+to-string ( u1 u2 u3 u4 -- c-addr u )
Convert MD5 result to the string, using the pictured output area

Inspection

md5-dump ( md5 -- )
Dump the md5 variable

Examples

\ ==============================================================================
\
\                 md5_expl - the MD5 example in the ffl
\
\               Copyright (C) 2009  Dick van Oudheusden
\  
\ This library is free software; you can redistribute it and/or
\ modify it under the terms of the GNU General Public
\ License as published by the Free Software Foundation; either
\ version 2 of the License, or (at your option) any later version.
\
\ This library is distributed in the hope that it will be useful,
\ but WITHOUT ANY WARRANTY; without even the implied warranty of
\ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
\ General Public License for more details.
\
\ You should have received a copy of the GNU General Public
\ License along with this library; if not, write to the Free
\ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
\
\ ==============================================================================
\ 
\  $Date: 2009-03-24 18:24:03 $ $Revision: 1.1 $
\
\ ==============================================================================

include ffl/md5.fs

\ Create a MD5 variable md1 in the dictionary

md5-create md1

\ Update the variable with data

s" The quick brown fox jumps over the lazy dog" md1 md5-update

\ Finish the MD5 calculation resulting in four unsigned 32 bit words
\ on the stack representing the hash value

md1 md5-finish

\ Convert the hash value to a hex string and print it

md5+to-string type cr



\ Create a MD5 variable on the heap

md5-new value md2

\ Update the variable with multiple data

s" The quick brown fox "    md2 md5-update
s" jumps over the lazy dog" md2 md5-update

\ Finish the calculation

md2 md5-finish

\ Convert the hash value to a hex string and print

md5+to-string type cr

\ Free the variable from the heap

md2 md5-free

Generated by fsdocgen 0.1.0