// SPDX-FileCopyrightText: 2021 Carl Schwan // // SPDX-License-Identifier: LGPL-2.1-or-later #ifdef Quotient_E2EE_ENABLED #include "olm/utils.h" using namespace Quotient; QByteArray Quotient::toKey(const Quotient::PicklingMode &mode) { if (std::holds_alternative(mode)) { return ""; } return std::get(mode).key; } QByteArray Quotient::getRandom(size_t bufferSize) { QByteArray buffer(bufferSize, '0'); std::generate(buffer.begin(), buffer.end(), std::rand); return buffer; } #endif