// Copyright (c) 2017 Pieter Wuille // Copyright (c) 2016-2024 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html // Bech32 is a string encoding format used in Sapling zaddrs // The output consists of a human-readable part (alphanumeric), a // separator character (1), and a base32 data section, the last // 6 characters of which are a checksum. // // For more information, see BIP 173. #ifndef HUSH_BECH32_H #define HUSH_BECH32_H #include #include #include namespace bech32 { /** Encode a Bech32 string. Returns the empty string in case of failure. */ std::string Encode(const std::string& hrp, const std::vector& values); /** Decode a Bech32 string. Returns (hrp, data). Empty hrp means failure. */ std::pair> Decode(const std::string& str); } // namespace bech32 #endif // HUSH_BECH32_H