| 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 | { |