[plt-scheme] Message digests: md5, sha1, etc.

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Mon Feb 5 13:20:37 EST 2007

Hi all,

Fresh of the press is set of bindings for the message digest
algorithms of libcrypto:


I have tested it on Windows, so I'd appreciate if a kind soul can
tell me, whether it works on OS X or Linux too. It ought to, but ...


 > (require (planet "digest.ss" ("soegaard" "digest.plt" 1 0)))
 > (digest #"abc" 'md5)
 > (digest #"abc" 'sha1)

Note that the libcrypto md5 is somewhat faster than (lib "md5.ss"):

 > (define b (make-bytes 10000000))
 > (md5 b)
 > (require (prefix mz: (lib "md5.ss")))
 > (mz:md5 b)
 > (time (md5 b))
cpu time: 16 real time: 15 gc time: 0
 > (time (mz:md5 b))
cpu time: 14734 real time: 15079 gc time: 0

Jens Axel Søgaard

Posted on the users mailing list.