2
0

MD5.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // System.Security.Cryptography MD5 Class implementation
  3. //
  4. // Authors:
  5. // Matthew S. Ford ([email protected])
  6. // Sebastien Pouliot ([email protected])
  7. //
  8. // Copyright 2001 by Matthew S. Ford.
  9. // Portions (C) 2002 Motus Technologies Inc. (http://www.motus.com)
  10. //
  11. using System.Security.Cryptography;
  12. namespace System.Security.Cryptography {
  13. /// <summary>
  14. /// Common base class for all derived MD5 implementations.
  15. /// </summary>
  16. public abstract class MD5 : HashAlgorithm {
  17. /// <summary>
  18. /// Called from constructor of derived class.
  19. /// </summary>
  20. // Why is it protected when others abstract hash classes are public ?
  21. protected MD5 ()
  22. {
  23. HashSizeValue = 128;
  24. }
  25. /// <summary>
  26. /// Creates the default derived class.
  27. /// </summary>
  28. public static new MD5 Create ()
  29. {
  30. return Create ("System.Security.Cryptography.MD5");
  31. }
  32. /// <summary>
  33. /// Creates a new derived implementation.
  34. /// </summary>
  35. /// <param name="hashName">Specifies which derived class to create</param>
  36. public static new MD5 Create (string hashName)
  37. {
  38. return (MD5) CryptoConfig.CreateFromName (hashName);
  39. }
  40. }
  41. }