MCPcopy Create free account
hub / github.com/christophhart/HISE / writeEncryptedObject

Method writeEncryptedObject

hi_scripting/scripting/api/ScriptingApiObjects.cpp:711–729  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

709}
710
711bool ScriptingObjects::ScriptFile::writeEncryptedObject(var jsonData, String key)
712{
713 auto data = key.getCharPointer().getAddress();
714 auto size = jlimit(0, 72, key.length());
715
716 BlowFish bf(data, size);
717
718 auto text = JSON::toString(jsonData, true);
719
720 MemoryOutputStream mos;
721 mos.writeString(text);
722 mos.flush();
723
724 auto out = mos.getMemoryBlock();
725
726 bf.encrypt(out);
727
728 return f.replaceWithText(out.toBase64Encoding());
729}
730
731String ScriptingObjects::ScriptFile::loadAsString() const
732{

Callers

nothing calls this directly

Calls 10

jlimitFunction · 0.85
getMemoryBlockMethod · 0.80
replaceWithTextMethod · 0.80
toBase64EncodingMethod · 0.80
toStringFunction · 0.50
getAddressMethod · 0.45
lengthMethod · 0.45
writeStringMethod · 0.45
flushMethod · 0.45
encryptMethod · 0.45

Tested by

no test coverage detected