SHA1.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // System.Security.Cryptography.SHA1 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. {
  14. /// <summary>
  15. /// Common base class for all derived SHA1 implementations.
  16. /// </summary>
  17. public abstract class SHA1 : HashAlgorithm
  18. {
  19. /// <summary>
  20. /// Called from constructor of derived class.
  21. /// </summary>
  22. protected SHA1 ()
  23. {
  24. HashSizeValue = 160;
  25. }
  26. /// <summary>
  27. /// Creates the default derived class.
  28. /// </summary>
  29. public static new SHA1 Create ()
  30. {
  31. return Create ("System.Security.Cryptography.SHA1");
  32. }
  33. /// <summary>
  34. /// Creates a new derived class.
  35. /// </summary>
  36. /// <param name="hashName">Specifies which derived class to create</param>
  37. public static new SHA1 Create (string hashName)
  38. {
  39. return (SHA1) CryptoConfig.CreateFromName (hashName);
  40. }
  41. }
  42. }