示例#1
0
        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);
            }
        }
示例#2
0
 // Ensure that permutations are precomputed prior to main run, so that processing times will be correct
 static StringsProcessor()
 {
     PrecomputedPermutationsGenerator.HamiltonianPermutations(1, 0);
 }