File indexing completed on 2024-04-28 05:50:08

0001 /*
0002  * SPDX-License-Identifier: GPL-3.0-or-later
0003  * SPDX-FileCopyrightText: 2019-2020 Johan Ouwerkerk <jm.ouwerkerk@gmail.com>
0004  */
0005 #ifndef BASE32_H
0006 #define BASE32_H
0007 
0008 #include <QByteArray>
0009 #include <QString>
0010 
0011 #include <optional>
0012 
0013 namespace base32
0014 {
0015     std::optional<size_t> validate(const QString &encoded, int from = 0, int until = -1);
0016     std::optional<size_t> decode(const QString &encoded, char * const out, size_t outlen, int from = 0, int until = -1);
0017 
0018     std::optional<QByteArray> decode(const QString &input);
0019 }
0020 #endif