Table of Contents

MessageDigest5 Class

Definition

Namespace
Cuemon.Security.Cryptography
Assemblies
Cuemon.Security.Cryptography.dll
Source
src/Cuemon.Security.Cryptography/MessageDigest5.cs

Provides a MD5 implementation of the MD (Message Digest) cryptographic hashing algorithm for 128-bit hash values. This class cannot be inherited. Implements the UnkeyedCryptoHash<TAlgorithm>

public sealed class MessageDigest5 : UnkeyedCryptoHash<MD5>, IHash, IConfigurable<ConvertibleOptions>
Inheritance
MessageDigest5
Implements
Inherited Members

Examples

The following example demonstrates how to compute an MD5 hash with .

using System;
using System.Text;
using Cuemon.Security.Cryptography;

namespace MyApp.Examples;

public static class MessageDigest5Example
{
    public static void Demonstrate()
    {
        var algorithm = new MessageDigest5();
        var result = algorithm.ComputeHash(Encoding.UTF8.GetBytes("The quick brown fox jumps over the lazy dog"));

        Console.WriteLine(MessageDigest5.BitSize);
        Console.WriteLine(result.GetBytes().Length);
        Console.WriteLine(result.ToHexadecimalString());
    }
}

Constructors

Name Description
MessageDigest5(Action<ConvertibleOptions>)

Initializes a new instance of the MessageDigest5 class.

Fields

Name Description
BitSize

Produces a 128-bit hash value

See Also

UnkeyedCryptoHash<TAlgorithm>
Hash<TOptions>