|
|
@ -2,6 +2,7 @@ |
|
|
|
{ |
|
|
|
{ |
|
|
|
using System; |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Collections.Generic; |
|
|
|
|
|
|
|
using System.Diagnostics; |
|
|
|
using System.Linq; |
|
|
|
using System.Linq; |
|
|
|
using System.Numerics; |
|
|
|
using System.Numerics; |
|
|
|
using System.Security.Cryptography; |
|
|
|
using System.Security.Cryptography; |
|
|
@ -17,6 +18,9 @@ |
|
|
|
/// </summary> |
|
|
|
/// </summary> |
|
|
|
public static void Main() |
|
|
|
public static void Main() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
var stopwatch = new Stopwatch(); |
|
|
|
|
|
|
|
stopwatch.Start(); |
|
|
|
|
|
|
|
|
|
|
|
var processor = new StringsProcessor("poultry outwits ants", 4); |
|
|
|
var processor = new StringsProcessor("poultry outwits ants", 4); |
|
|
|
var expectedHashes = new[] |
|
|
|
var expectedHashes = new[] |
|
|
|
{ |
|
|
|
{ |
|
|
@ -31,9 +35,12 @@ |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (expectedHashesAsVectors.Contains(result.Item2)) |
|
|
|
if (expectedHashesAsVectors.Contains(result.Item2)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Console.WriteLine($"Found phrase: {result.Item1}"); |
|
|
|
Console.WriteLine($"Found phrase: {result.Item1} (spent {stopwatch.Elapsed})"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stopwatch.Stop(); |
|
|
|
|
|
|
|
Console.WriteLine($"Total time spent: {stopwatch.Elapsed}"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Code taken from http://stackoverflow.com/a/321404/831314 |
|
|
|
// Code taken from http://stackoverflow.com/a/321404/831314 |
|
|
|