Paste: string>md5

Author: randy
Mode: factor
Date: Wed, 18 Feb 2009 09:56:25
Plain Text |
: [0-9]-char? ( chr -- ? )
    [ length 2 < ] [ first [ 48 > ] [ 57 < ] bi and ] bi and ;
             
: string>md5 ( str -- md5 )
    md5 checksum-bytes >array
    [ >hex dup [0-9]-char? [ CHAR: 0 prefix ] when ] map
    "" join ;

Annotation: nope - forget previous

Author: randy7
Mode: factor
Date: Wed, 18 Feb 2009 09:59:39
Plain Text |
! even single chars should get 0 actually.

            
: string>md5 ( str -- md5 )
    md5 checksum-bytes >array
    [ >hex dup length 2 < [ CHAR: 0 prefix ] when ] map
    "" join ;

Annotation: use concat

Author: ..
Mode: factor
Date: Wed, 18 Feb 2009 10:05:13
Plain Text |
concat instead of "" join.

New Annotation

Summary:
Author:
Mode:
Body: