/* Copyright (C) CJ Affiliate * * You may use, distribute and modify this code under the * terms of the GNU General Public License version 2 or * later. * * You should have received a copy of the license with this * file. If not, you will find a copy in the "LICENSE" file * at https://github.com/cjdev/dual-control. */ #ifndef BASE32_H #define BASE32_H #include #include #include class invalid_data_exception : public std::exception { }; class base32_ifc { public: virtual std::string encode (std::vector input) const = 0; virtual std::vector decode (std::string input) const = 0; }; class base32 { public: using delegate = std::shared_ptr; private: delegate delegate_; public: base32 (); std::string encode (std::vector input) const { return delegate_->encode (input); }; std::vector decode (std::string input) const { return delegate_->decode (input); }; }; #endif