improve to_qr_string doc

This commit is contained in:
Riccardo Casatta 2021-03-23 09:40:19 +01:00
parent d18554e756
commit cac3f460a2
No known key found for this signature in database
GPG Key ID: FD986A969E450397
1 changed files with 5 additions and 1 deletions

View File

@ -353,7 +353,11 @@ impl Address {
self.payload.script_pubkey() 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 { pub fn to_qr_string(&self) -> String {
let address_string = self.to_string(); let address_string = self.to_string();
match self.payload { match self.payload {