]> Git Repo - VerusCoin.git/blame - src/bech32.h
improve check
[VerusCoin.git] / src / bech32.h
CommitLineData
10e5357e
PW
1// Copyright (c) 2017 Pieter Wuille
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5// Bech32 is a string encoding format used in newer address types.
6// The output consists of a human-readable part (alphanumeric), a
7// separator character (1), and a base32 data section, the last
8// 6 characters of which are a checksum.
9//
10// For more information, see BIP 173.
11
768cd14c
JG
12#ifndef BITCOIN_BECH32_H
13#define BITCOIN_BECH32_H
14
10e5357e
PW
15#include <stdint.h>
16#include <string>
17#include <vector>
18
19namespace bech32
20{
21
22/** Encode a Bech32 string. Returns the empty string in case of failure. */
23std::string Encode(const std::string& hrp, const std::vector<uint8_t>& values);
24
25/** Decode a Bech32 string. Returns (hrp, data). Empty hrp means failure. */
26std::pair<std::string, std::vector<uint8_t>> Decode(const std::string& str);
27
28} // namespace bech32
768cd14c
JG
29
30#endif // BITCOIN_BECH32_H
This page took 0.054926 seconds and 4 git commands to generate.