[IronPython] md5 for IronPython
Shawn Farkas
Shawn.Farkas at microsoft.com
Thu Jan 26 18:43:31 CET 2006
The reason we use a string is that it's actually a fully pluggable framework. For instance, someone in the NSA could have a top-secret hash algorithm that we didn't put into the framework. They could implement it themselves, register it in machine.config, and then do HashAlgorithm.Create("SuperSecretNSAHash") and it would work.
-Shawn
-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer
Sent: Thursday, January 26, 2006 9:38 AM
To: Discussion of IronPython
Subject: Re: [IronPython] md5 for IronPython
Unless I'm lacking sleep and miss something (likely), you could make an
overload that took an enum, such as the pre-existing ones in the
framework.
-----
Keith J. Farmer // kfarmer at thuban.org
-----Original Message-----
From: users-bounces at lists.ironpython.com
[mailto:users-bounces at lists.ironpython.com] On Behalf Of Shawn Farkas
Sent: Thursday, 26 January 2006 09:08
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.
_______________________________________________
users mailing list
users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
More information about the Ironpython-users
mailing list