rust-lightning/lightning-invoice
Matt Corallo 5c1440afec Hold a reference to byte arrays when serializing to bech32
When we serialize from a byte array to bech32 in
`lightning-invoice`, we can either copy the array itself into the
iterator or hold a reference to the array and iterate through that.

In aa2f6b47df we opted to copy the
array into the iterator, which is fine for the current array sizes
we're working with, but does result in additional memory on the
stack if, in the future, we end up writing large arrays.

Instead, here, we switch to using the slice serialization code when
writing arrays, (very marginally) reducing code size and reducing
stack usage.
2024-10-03 22:21:55 +00:00
..
src Hold a reference to byte arrays when serializing to bech32 2024-10-03 22:21:55 +00:00
tests Upgrade bech32 dependency, bech32 serialization improvements 2024-10-02 21:21:07 +02:00
.gitignore Pure import of lightning-invoice crate 2021-04-09 10:08:27 -04:00
Cargo.toml Upgrade bech32 dependency, bech32 serialization improvements 2024-10-02 21:21:07 +02:00
README.md Clean up lightning-invoice Cargo.toml and README 2021-04-09 10:08:27 -04:00

lightning-invoice

Docs.rs

This repo provides data structures for BOLT 11 lightning invoices and functions to parse and serialize these from and to bech32.

Please be sure to run the test suite since we need to check assumptions regarding SystemTime's bounds on your platform. You can also call check_platform on startup or in your test suite to do so.