From cac3f460a265d5c50a813358d02fa881beab5272 Mon Sep 17 00:00:00 2001 From: Riccardo Casatta Date: Tue, 23 Mar 2021 09:40:19 +0100 Subject: [PATCH] improve to_qr_string doc --- src/util/address.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/util/address.rs b/src/util/address.rs index d0192507..cd8979ce 100644 --- a/src/util/address.rs +++ b/src/util/address.rs @@ -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, meaning it becomes uppercase if bech32. + /// 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 {