本文整理汇总了C++中BigInteger::parseString方法的典型用法代码示例。如果您正苦于以下问题:C++ BigInteger::parseString方法的具体用法?C++ BigInteger::parseString怎么用?C++ BigInteger::parseString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BigInteger
的用法示例。
在下文中一共展示了BigInteger::parseString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createRSAKey
void createRSAKey()
{
int bits = jlimit (32, 512, bitSize.getText().getIntValue());
bitSize.setText (String (bits), dontSendNotification);
// Create a key-pair...
RSAKey publicKey, privateKey;
RSAKey::createKeyPair (publicKey, privateKey, bits);
// Test the new key on a piece of data...
BigInteger testValue;
testValue.parseString ("1234567890abcdef", 16);
BigInteger encodedValue (testValue);
publicKey.applyToValue (encodedValue);
BigInteger decodedValue (encodedValue);
privateKey.applyToValue (decodedValue);
// ..and show the results..
String message;
message << "Number of bits: " << bits << newLine
<< "Public Key: " << publicKey.toString() << newLine
<< "Private Key: " << privateKey.toString() << newLine
<< newLine
<< "Test input: " << testValue.toString (16) << newLine
<< "Encoded: " << encodedValue.toString (16) << newLine
<< "Decoded: " << decodedValue.toString (16) << newLine;
rsaResultBox.setText (message, false);
}
示例2: decryptXML
//==============================================================================
static XmlElement decryptXML (String hexData, RSAKey rsaPublicKey)
{
BigInteger val;
val.parseString (hexData, 16);
RSAKey key (rsaPublicKey);
jassert (key.isValid());
ScopedPointer<XmlElement> xml;
if (! val.isZero())
{
key.applyToValue (val);
const MemoryBlock mb (val.toMemoryBlock());
if (CharPointer_UTF8::isValidString (static_cast<const char*> (mb.getData()), (int) mb.getSize()))
xml = XmlDocument::parse (mb.toString());
}
return xml != nullptr ? *xml : XmlElement("key");
}
示例3:
int64 HiseJavascriptEngine::RootObject::getOctalValue(const String& s)
{
BigInteger b; b.parseString(s, 8); return b.toInt64();
}