Changeset View
Changeset View
Standalone View
Standalone View
src/cashaddr.h
- This file was added.
// Copyright (c) 2017 Pieter Wuille | |||||
// Copyright (c) 2017 The Bitcoin developers | |||||
// Distributed under the MIT software license, see the accompanying | |||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | |||||
// Cash address based on bech32, but modified for Bitcoin Cash. | |||||
// Bech32 is a string encoding format used in newer address types. | |||||
// 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. | |||||
#include <stdint.h> | |||||
#include <string> | |||||
#include <vector> | |||||
namespace cashaddr { | |||||
/** | |||||
* Encode a Cash address string. Returns the empty string in case of failure. | |||||
*/ | |||||
std::string Encode(const std::string &prefix, | |||||
const std::vector<uint8_t> &values); | |||||
/** | |||||
* Decode a Cash address string. Returns (prefix, data). Empty prefix means | |||||
* failure. | |||||
*/ | |||||
std::pair<std::string, std::vector<uint8_t>> Decode(const std::string &str); | |||||
} // namespace cashaddr |