-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 5-Dec-06, at 12:16 AM, |/|/ Bendick wrote:
Anyone have (or know of) an efficient way of getting a sha1 digest of some data in gambit?
All I could find was http://www-pu.informatik.uni-tuebingen.de/users/knauel/sw/myscsh/ sha1.scm
which (after minor hacking) can do:
(time (sha1-hash-byte-vector (make-u8vector 1000000))) 301187 ms real time 135097 ms cpu time (130412 user, 4685 system) 25815 collections accounting for 108377 ms real time (46618 user, 1795 system) 3598449540 bytes allocated no minor faults no major faults 1090135108572819471271096978636225236080936489142
Way too slow for even moderately large data. Can anyone help?
The Gambit distribution contains optimized implementations of MD5, SHA-1, SHA-224, and SHA-256 in the file lib/digest.scm . They could be optimized further (especially for SHA-224 and SHA-256) but MD5 and SHA-1 run much faster than the other Scheme versions I have encountered and they allocate very little.
Marc