Minor code cleanup + microoptimization + readme update

feature-optimized-md5
Inga 🏳‍🌈 8 years ago
parent b092c19989
commit fc5164fde2
  1. 2
      README.md
  2. 2
      WhiteRabbit/PermutationsGenerator.cs
  3. 2
      WhiteRabbit/StringsProcessor.cs
  4. 2
      WhiteRabbit/VectorsConverter.cs
  5. 2
      WhiteRabbit/VectorsProcessor.cs

@ -28,7 +28,7 @@ Multi-threaded performance with RyuJIT (.NET 4.6, 64-bit system) on quad-core Sa
* If phrases of 6 words are allowed as well, then "more difficult" hash is solved in 30 seconds, "easiest" in 3 minutes, and "hard" in 6 minutes.
* If phrases of 7 words are allowed as well, then "more difficult" hash is solved in 6 minutes.
* If phrases of 7 words are allowed as well, then "more difficult" hash is solved in 3 minutes.
Note that all measurements were done on a Release build; Debug build is significantly slower.

@ -8,7 +8,7 @@
/// <summary>
/// Code taken from https://ericlippert.com/2013/04/22/producing-permutations-part-three/
/// </summary>
internal class PermutationsGenerator
internal sealed class PermutationsGenerator
{
public static IEnumerable<Permutation> HamiltonianPermutations(int n)
{

@ -6,7 +6,7 @@
using System.Linq;
using System.Numerics;
internal class StringsProcessor
internal sealed class StringsProcessor
{
public StringsProcessor(byte[] sourceString, int maxWordsCount, IEnumerable<byte[]> words)
{

@ -9,7 +9,7 @@
/// Converts strings to vectors containing chars count, based on a source string.
/// E.g. for source string "abc", string "a" is converted to [1, 0, 0], while string "bcb" is converted to [0, 2, 1].
/// </summary>
internal class VectorsConverter
internal sealed class VectorsConverter
{
public VectorsConverter(byte[] sourceString)
{

@ -7,7 +7,7 @@
using System.Linq;
using System.Numerics;
internal class VectorsProcessor
internal sealed class VectorsProcessor
{
private const byte MaxComponentValue = 8;
private const int LeastCommonMultiple = 840;

Loading…
Cancel
Save