Example #1
0
const MidiMessage createFromHexData (const String &hexData)
{
	MemoryBlock bl;
	bl.loadFromHexString(hexData);

	return (MidiMessage ((uint8*)bl.getData(), (int)bl.getSize()));
}
Example #2
0
Uuid& Uuid::operator= (const String& uuidString)
{
    MemoryBlock mb;
    mb.loadFromHexString (uuidString);
    mb.ensureSize (sizeof (uuid), true);
    mb.copyTo (uuid, 0, sizeof (uuid));
    return *this;
}
Example #3
0
const String CtrlrMidiBufferStatus::hexString(const String &hex)
{
	String ret;
	MemoryBlock mb;
	mb.loadFromHexString (hex);
	uint8 *ptr = (uint8*)mb.getData();
	for (size_t i=0; i<mb.getSize(); i++)
	{
		const String bis = BigInteger (*(ptr+i)).toString(2, 8);
		ret << String::formatted ("[0x%.2x/%.3d/", *(ptr+i), *(ptr+i)) << bis.substring(0,4) << ":" << bis.substring(4,8) << "] ";
	}

	return (ret.trim());
}
Example #4
0
void CtrlrMIDIBuffer::loadTextFile(const File fileToOpen)
{
	if (fileToOpen == File::nonexistent)
	{
		lastFile = browseForFile("*.syx;*.bin;*.dat;*.*");
	}
	else
	{
		lastFile = fileToOpen;
	}

    MemoryBlock data;
	data.loadFromHexString (lastFile.loadFileAsString());
	reloadEditor (lastFile.loadFileAsString(), true);
}
String EncryptedString::decrypt (const String& encryptedString, const String& privateKey, bool inputIsHex)
{
    RSAKey rsaKey (privateKey);
    
    MemoryBlock encryptedMemoryBlock;
    
    if (inputIsHex)
    {
        encryptedMemoryBlock.loadFromHexString (encryptedString);
    }
    else
    {
        encryptedMemoryBlock.fromBase64Encoding (encryptedString);
    }

    BigInteger stringAsData;
    stringAsData.loadFromMemoryBlock (encryptedMemoryBlock);
    
    rsaKey.applyToValue (stringAsData);
    
    return stringAsData.toMemoryBlock().toString();
}
Example #6
0
MemoryBlock CtrlrMIDIBuffer::getData()
{
	MemoryBlock bl;
	bl.loadFromHexString (document.getAllContent());
	return (bl);
}
size_t CtrlrMIDITransaction::getDataLengthFromFormula(const String &formula)
{
	MemoryBlock bl;
	bl.loadFromHexString (formula);
	return (bl.getSize());
}