我想用C#风格语言编写一个类似里程表的方法,但不是只使用0-9来表示字符,而是使用任何字符集。它会或多或少地像一个暴力应用程序。算法:里程表/蛮力
如果我在字符从一个炭数组传递给Ĵ,并设置长度为5,我要像00000,00001,00002 ... HJJJJ,IJJJJJ,JJJJJ结果。
这是基础,请帮我扩大:
protected void Main()
{
char[] chars = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J' };
BruteForce(chars, 5);
}
private void BruteForce(char[] chars, int length)
{
// for-loop (?) console-writing all possible combinations from 00000 to JJJJJ
// (when passed in length is 5)
// TODO: Implement code...
}
密码破解,我们? – KristoferA 2008-10-23 07:14:35
哈哈,我不认为我的笔记本电脑是现代密码的现实蛮力机器:)它更适用于大脑超常规和乐趣。 – 2008-10-23 07:33:49