Class SecureHashAlgorithm1
- Namespace
- Cuemon.Security.Cryptography
- Assembly
- Cuemon.Security.Cryptography.dll
Provides a SHA-1 implementation of the SHA (Secure Hash Algorithm) cryptographic hashing algorithm for 160-bit hash values. This class cannot be inherited. Implements the UnkeyedCryptoHash<TAlgorithm>
public sealed class SecureHashAlgorithm1 : UnkeyedCryptoHash<SHA1>, IHash, IConfigurable<ConvertibleOptions>
- Inheritance
-
SecureHashAlgorithm1
- Implements
- Inherited Members
Examples
The following example demonstrates how to compute a SHA-1 hash with
using System;
using System.Text;
using Cuemon.Security.Cryptography;
namespace MyApp.Examples;
public static class SecureHashAlgorithm1Example
{
public static void Demonstrate()
{
var algorithm = new SecureHashAlgorithm1();
var result = algorithm.ComputeHash(Encoding.UTF8.GetBytes("legacy-compatible digest"));
Console.WriteLine(SecureHashAlgorithm1.BitSize);
Console.WriteLine(result.GetBytes().Length);
}
}
Constructors
SecureHashAlgorithm1(Action<ConvertibleOptions>)
Initializes a new instance of the SecureHashAlgorithm1 class.
public SecureHashAlgorithm1(Action<ConvertibleOptions> setup = null)
Parameters
setupAction<ConvertibleOptions>The ConvertibleOptions which may be configured.
Fields
BitSize
Produces a 160-bit hash value
public const int BitSize = 160
Field Value
See Also
UnkeyedCryptoHash<TAlgorithm>
Hash<TOptions>