diff options
author | Fabian Jahr <fjahr@protonmail.com> | 2021-03-18 00:43:35 +0100 |
---|---|---|
committer | Pieter Wuille <pieter@wuille.net> | 2021-03-17 17:59:22 -0700 |
commit | 03346022d611871f2cc185440b19d928b9264d9d (patch) | |
tree | 61a922bffa5a87aed085658632dc2ed7b0f74d82 /src/bech32.cpp | |
parent | 2e7c80fb5be82ad4a3f737cab65b31f70a772a23 (diff) |
naming nits
Diffstat (limited to 'src/bech32.cpp')
-rw-r--r-- | src/bech32.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bech32.cpp b/src/bech32.cpp index 289e0213e8..288b14e023 100644 --- a/src/bech32.cpp +++ b/src/bech32.cpp @@ -15,10 +15,10 @@ namespace typedef std::vector<uint8_t> data; -/** The Bech32 character set for encoding. */ +/** The Bech32 and Bech32m character set for encoding. */ const char* CHARSET = "qpzry9x8gf2tvdw0s3jn54khce6mua7l"; -/** The Bech32 character set for decoding. */ +/** The Bech32 and Bech32m character set for decoding. */ const int8_t CHARSET_REV[128] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -150,8 +150,8 @@ data CreateChecksum(Encoding encoding, const std::string& hrp, const data& value /** Encode a Bech32 or Bech32m string. */ std::string Encode(Encoding encoding, const std::string& hrp, const data& values) { - // First ensure that the HRP is all lowercase. BIP-173 requires an encoder - // to return a lowercase Bech32 string, but if given an uppercase HRP, the + // First ensure that the HRP is all lowercase. BIP-173 and BIP350 require an encoder + // to return a lowercase Bech32/Bech32m string, but if given an uppercase HRP, the // result will always be invalid. for (const char& c : hrp) assert(c < 'A' || c > 'Z'); data checksum = CreateChecksum(encoding, hrp, values); |