Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RFC9285 base45 support and more options. #15

Merged
merged 2 commits into from
Aug 27, 2024
Merged

Conversation

davidlehn
Copy link
Member

  • Add RFC9285 base45 support for more efficient encoding than base32.
    • Defaulting to base32 until the next major release.
  • More toQrCode options available:
    • qrMultibaseEncoding: Encoding for QR data. B for base32, R for base45. base45 is more efficient. Defaults to base32.
    • qrErrorCorrectionLevel: Error correction level used in the QR code. 'L' Low 7%, 'M' Medium 15%, 'Q' Qartile 25%, 'H' High 30%. Defaults to 'L'.
    • qrVersion: QR version. 1-40 or 0 for auto. Defaults to auto.

@davidlehn davidlehn requested a review from dlongley June 22, 2024 06:05
- Add RFC9285 base45 support for more efficient encoding than base32.
  - Defaulting to base32 until the next major release.
- More `toQrCode` options available:
  - `qrMultibaseEncoding`: Encoding for QR data. `B` for base32, `R` for
    base45. base45 is more efficient. Defaults to base32.
  - `qrErrorCorrectionLevel`: Error correction level used in the QR
    code. 'L' Low 7%, 'M' Medium 15%, 'Q' Qartile 25%, 'H' High 30%.
    Defaults to 'L'.
  - `qrVersion`: QR version. 1-40 or 0 for auto. Defaults to auto.
Comment on lines +116 to +120
- `qrMultibaseEncoding`: Encoding for QR data. `B` for [RFC4648][] base32, `R`
for [RFC9285][] base45. base45 is more efficient. Defaults to base32.
- `qrErrorCorrectionLevel`: Error correction level used in the QR code. 'L' Low
7%, 'M' Medium 15%, 'Q' Qartile 25%, 'H' High 30%. Defaults to 'L'.
- `qrVersion`: QR version. 1-40 or 0 for auto. Defaults to auto.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another way to do this would be under the options.qr namespace (e.g., options.qr.multibaseEncoding, ...). I'm ok with either.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suffering analysis paralysis with this and differences in libraries and use cases. Going to go with something for now and will adjust in major releases later as needed and experience is gained.

@davidlehn davidlehn merged commit 4e8caef into main Aug 27, 2024
5 checks passed
@davidlehn davidlehn deleted the add-base45-and-options branch August 27, 2024 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants