43 lines
1.1 KiB
C#
43 lines
1.1 KiB
C#
using System;
|
|
using System.Diagnostics;
|
|
|
|
internal class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
Stopwatch sw = new Stopwatch();
|
|
sw.Start();
|
|
string hashed = Hashers.Argon2id_hash("Hello");
|
|
sw.Stop();
|
|
Console.WriteLine("Elapsed={0}", sw.Elapsed);
|
|
Console.WriteLine(hashed);
|
|
Console.ReadKey();
|
|
|
|
sw = new Stopwatch();
|
|
sw.Start();
|
|
bool verified = Hashers.Argon2id_verify("Hello", hashed);
|
|
sw.Stop();
|
|
|
|
Console.WriteLine("Elapsed={0}", sw.Elapsed);
|
|
Console.WriteLine(verified);
|
|
Console.ReadKey();
|
|
|
|
|
|
sw = new Stopwatch();
|
|
sw.Start();
|
|
hashed = Hashers.Argon2id_hash_custom("Hello", 2, 20, 1, 32);
|
|
sw.Stop();
|
|
Console.WriteLine("Elapsed={0}", sw.Elapsed);
|
|
Console.WriteLine(hashed);
|
|
Console.ReadKey();
|
|
|
|
sw = new Stopwatch();
|
|
sw.Start();
|
|
verified = Hashers.Argon2id_verify("Hello", hashed);
|
|
sw.Stop();
|
|
|
|
Console.WriteLine("Elapsed={0}", sw.Elapsed);
|
|
Console.WriteLine(verified);
|
|
Console.ReadKey();
|
|
}
|
|
}
|