Cotton code
23 lines · 1.0 KB · RustRaw
//! A QR encoder, hand-written and dependency-free.//!//! The scope is deliberate: byte mode, error-correction level M, versions//! 1–10, and nothing else. The symbol is not decoration — the OAuth consent//! page draws one so a phone can learn a home server's address, and a person//! standing in front of that page either scans it or does not.//!//! It stays hand-written HERE for a second reason. The consent page's SVG is//! wire: `oauth.page.test.ts` compares the `<path>` this produces against the//! one the TypeScript produces for the same payload, and the four penalty//! rules that pick the mask are exactly where two conforming encoders are//! allowed to disagree. A crate off the shelf would be a different encoder//! making a different legal choice, and the page would drift a byte at a time//! with nothing to say it had.//!//! Follows ISO/IEC 18004; the tables are the standard's, level M only.mod encode;pub use encode::{    encode_qr, qr_svg, rs_encode, QrError, QrErrorKind, QrMatrix, QrSvgOptions, MAX_VERSION,    MIN_VERSION,};