Constant MAX_LENGTH

pub const MAX_LENGTH: usize = 7089; // 7_089usize
Expand description

lightning-invoice will reject BOLT11 invoices that are longer than 7089 bytes.

§Rationale

This value matches LND’s implementation, which was chosen to be “the max number of bytes that can fit in a QR code”. LND’s rationale is technically incorrect as QR codes actually have a max capacity of 7089 numeric characters and only support up to 4296 all-uppercase alphanumeric characters. However, ecosystem-wide consistency is more important.