CSharpTest.Net
WhirlpoolManaged Constructor
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Crypto Namespace > WhirlpoolManaged Class : WhirlpoolManaged Constructor

Glossary Item Box

Syntax

Visual Basic (Declaration) 
Public Function New()
C# 
public WhirlpoolManaged()

Example

Library/Library.Test/TestWhirlpoolHash.cs

C#Copy Code
byte[] speedInput = System.Text.Encoding.ASCII.GetBytes("12345678901234567890123456789012345678901234567890123456789012345678901234567890");

Stopwatch sw;

HashAlgorithm sha512 = SHA512.Create();
WhirlpoolManaged alg = new WhirlpoolManaged();

for (int rep = 3; rep > 0; rep--)
{
    sw = new Stopwatch();
    sw.Start();
    for (int i = 0; i < 100000; i++)
        sha512.ComputeHash(speedInput);
    sw.Stop();
    Console.WriteLine("100000 SHA512 in     {0}", sw.Elapsed);

    sw = new Stopwatch();
    sw.Start();
    for (int i = 0; i < 100000; i++)
        alg.ComputeHash(speedInput);
    sw.Stop();
    Console.WriteLine("100000 WhirlpoolT in {0}", sw.Elapsed);
}
VB.NETCopy Code
Dim speedInput As Byte() = System.Text.Encoding.ASCII.GetBytes("12345678901234567890123456789012345678901234567890123456789012345678901234567890")

Dim sw As Stopwatch

Dim sha512 As HashAlgorithm = SHA512.Create()
Dim alg As New WhirlpoolManaged()

Dim rep As Integer = 3
While rep > 0
    sw = New Stopwatch()
    sw.Start()
    Dim i As Integer = 0
    While i < 100000
        sha512.ComputeHash(speedInput)
        System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
    End While
    sw.[Stop]()
    Console.WriteLine("100000 SHA512 in     {0}", sw.Elapsed)

    sw = New Stopwatch()
    sw.Start()
    Dim i As Integer = 0
    While i < 100000
        alg.ComputeHash(speedInput)
        System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
    End While
    sw.[Stop]()
    Console.WriteLine("100000 WhirlpoolT in {0}", sw.Elapsed)
    System.Math.Max(System.Threading.Interlocked.Decrement(rep),rep + 1)
End While

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys