private void ProcessSum(int[] sum, uint[] expectedHashesVector, Action <byte[], uint> action) { var initialPhraseSet = new PhraseSet(); initialPhraseSet.Init(); initialPhraseSet.FillLength(this.NumberOfCharacters, sum.Length); var phraseSet = new PhraseSet(); phraseSet.Init(); var permutationsFilter = ComputeFilter(sum); var wordsVariants = this.ConvertVectorsToWordIndexes(sum); foreach (var wordsArray in Flattener.Flatten(wordsVariants)) { phraseSet.ProcessPermutations( initialPhraseSet, this.AllWords, wordsArray, PrecomputedPermutationsGenerator.HamiltonianPermutations(wordsArray.Length, permutationsFilter), expectedHashesVector, action); } }
// Ensure that permutations are precomputed prior to main run, so that processing times will be correct static StringsProcessor() { PrecomputedPermutationsGenerator.HamiltonianPermutations(1, 0); }