Skip to content

Commit

Permalink
improve to_qr_string doc
Browse files Browse the repository at this point in the history
  • Loading branch information
RCasatta committed Mar 23, 2021
1 parent d18554e commit 342122e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/util/address.rs
Expand Up @@ -353,7 +353,11 @@ impl Address {
self.payload.script_pubkey()
}

/// Creates a string optimized to be encoded in QR codes, meaning it becomes uppercase if bech32
/// Creates a string optimized to be encoded in QR codes.
/// Quoting BIP 173 "inside QR codes uppercase SHOULD be used, as those permit the use of
/// alphanumeric mode, which is 45% more compact than the normal byte mode."
/// Even inside Bitcoin URI may be more efficient to use the uppercase address since in QR codes
/// encoding modes can be mixed as needed within a QR symbol.
pub fn to_qr_string(&self) -> String {
let address_string = self.to_string();
match self.payload {
Expand Down

0 comments on commit 342122e

Please sign in to comment.