本文整理汇总了C#中IntX.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# IntX.ToString方法的具体用法?C# IntX.ToString怎么用?C# IntX.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IntX
的用法示例。
在下文中一共展示了IntX.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateBinaryString
public String GenerateBinaryString(IntX number)
{
Char[] str = new Char[this.size];
for (int i = 0; i < str.Length; i++)
str[i] = '0';
var temp = number.ToString(2);
for (int i = 0; i < temp.Length; i++)
str[i] = temp[i];
return new String(str);
}
示例2: writeKeys
//Writes keys to file
public static void writeKeys(IntX n, IntX e, IntX d, string privPath, string pubPath) {
string[] pub = new string[2];
pub[0] = n.ToString();
pub[1] = e.ToString();
System.IO.File.WriteAllLines(pubPath, pub);
string[] pri = new string[2];
pri[0] = n.ToString();
pri[1] = d.ToString();
System.IO.File.WriteAllLines(privPath, pri);
}
示例3: GeneratePrime
public static IntX GeneratePrime(IntX maximum)
{
return MathAlgs.GeneratePrime(maximum.ToString(2).Length - 1);
}
示例4: writeToFile
//Writes encrypted data to file.
public static void writeToFile(IntX[] encrypted, string path, IntX key_n, IntX key_d ) {
string[] output = new string[encrypted.Length+2];
output[0] = key_n.ToString();
output[1] = key_d.ToString();
int count = 2;
for(int i = 0; i < encrypted.Length; i++) {
output[count] = encrypted[i].ToString();
count++;
}
//System.IO.File.WriteAllText(path, key_n.ToString());
//System.IO.File.WriteAllText(path, key_d.ToString());
System.IO.File.WriteAllLines(path, output);
}
示例5: GenerateBitArray
public static BitArray GenerateBitArray(IntX number)
{
string numberBinary = number.ToString(2);
BitArray br = new BitArray(numberBinary.Length);
for (int i = 0; i < br.Length; i++)
{
if (numberBinary[i] == '1')
br[i] = true;
}
return br;
}