If you wanted to easily extend it to other algorithms, then instead of using 
MD5.Create() in your __init__, you could instead do HashAlgorithm.Create("MD5").

That allows you to swap in any hash algorithm you'd like (and that the 
framework supports) just by swapping the string.

-Shawn

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sanghyeon Seo
Sent: Thursday, January 26, 2006 2:55 AM
To: [email protected]
Subject: [IronPython] md5 for IronPython

md5 module is implemented as a C extension module in CPython. As this
is currently not included in IronPython, I wrote a tiny wrapper around
System.Security.Cryptography. Here it is in case you want it too.

http://sparcs.kaist.ac.kr/~tinuviel/devel/fepy/md5.py

It's under 30 lines!

It should be trivial to adapt this to other hash algorithms.

Seo Sanghyeon
_______________________________________________
users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________
users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to