目前我正在尝试做这个挑战(http://cryptopals.com/sets/1/challenges/1),我在使用C#完成任务时遇到了一些麻烦.我似乎无法将数字解析成一个大整数.
所以代码如下所示:
string output = "";
BigInteger hexValue = BigInteger.Parse("49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6");
output = Convert.ToBase64String(hexValue.ToByteArray());
Console.WriteLine(hexValue);
Console.WriteLine(output);
Console.ReadKey();
return "";
Run Code Online (Sandbox Code Playgroud)
目前我遇到的问题是当我运行程序时它失败并出现错误
System.FormatException:'无法解析该值.' 而且我不完全确定为什么.
那么,从字符串中获取大整数到BigInt的合适方法是什么?