public static MessageDigest GetInstance (string algorithm)
{
switch (algorithm.ToLower ()) {
case "sha-1":
return new MessageDigest<SHA1Managed> ();
case "md5":
return new MessageDigest<MD5CryptoServiceProvider> ();
}
throw new NotSupportedException (string.Format ("The requested algorithm \"{0}\" is not supported.", algorithm));
}