MCPcopy Create free account
hub / github.com/OneLoneCoder/olcPixelGameEngine / scramble

Method scramble

olcPixelGameEngine.h:2453–2460  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2451 }
2452
2453 std::vector<char> ResourcePack::scramble(const std::vector<char>& data, const std::string& key)
2454 {
2455 if (key.empty()) return data;
2456 std::vector<char> o;
2457 size_t c = 0;
2458 for (auto s : data) o.push_back(s ^ key[(c++) % key.size()]);
2459 return o;
2460 };
2461
2462 std::string ResourcePack::makeposix(const std::string& path)
2463 {

Callers

nothing calls this directly

Calls 3

emptyMethod · 0.80
push_backMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected