constantoine / totp-rs

RFC-compliant TOTP implementation with ease of use as a goal and additionnal QoL features.
https://crates.io/crates/totp-rs
MIT License
180 stars 23 forks source link

QR option as cargo feature #4

Closed marknijboer closed 4 years ago

marknijboer commented 4 years ago

Hi, I like your easy to use implementation of TOTP. I use it in a project for web authentication, but I provide my own QR code library. Would it be possible to set the QR option as a cargo feature which can be turned off? This would slim down the dependency list for when the QR feature is not used

constantoine commented 4 years ago

Hi! First of all, thanks! It means a lot to me to know my implementation is found useful in people's project! That's a very good suggestion and it divides by 3 the number of dependencies cargo has to compile when I'm not using the qr generation feature!

I just published version 0.3.0 as a response. Now to use built-in qrcode generation, you'll have to compile it with the "qr" feature. It is not in the default features as I don't really know if majority of people using my crate actually are using it or not, so I hope this is a sane default state.

Again, thanks a lot for your issue and comment!

marknijboer commented 4 years ago

Thank you for the change! It works perfectly and it saves me from installing a lot of dependencies that I don't use. Compiling is a lot faster now.

I think that, as you said, keeping the qr feature disabled as a default is a good choice. When people need it, it is pretty easy to enable.

Thanks a lot!