valeriansaliou / rs-card-validate

:credit_card: Detects and validates credit card numbers (type of card, number length and Luhn checksum).
https://crates.io/crates/card-validate
MIT License
19 stars 6 forks source link

Making validation functions public/accessible #4

Closed rohitjoshi closed 6 years ago

rohitjoshi commented 6 years ago

Can you make is_luhn_valid(), is_length_valid() and evaluate_type() public so we can selectively invoke specific type of validation?

Also, it would be helpful validation at the bin (first 6 digits) level.

valeriansaliou commented 6 years ago

Hi!

Would it be better for you if the returned result contains those sub-values? This would be handier than calling each specific functions once again; as when you validate a card they are called (this would avoid extra-computations, but Iā€™m being picky there).

--

Valerian Saliou CTO at Crisp https://crisp.chat/ & Enrich https://enrichdata.com/ ā€” About me https://valeriansaliou.name/

On Feb 8, 2018, at 7:35 PM, Rohit Joshi notifications@github.com wrote:

Can you make is_luhn_valid(), is_length_valid() and evaluate_type() public so we can selectively invoke specific type of validation?

Also, it would be helpful validation at the bin (first 6 digits) level.

ā€” You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/valeriansaliou/rs-card-validate/issues/4, or mute the thread https://github.com/notifications/unsubscribe-auth/ABYng5Wz0-nikt75yr7v0o8hiVWAjVWSks5tSz55gaJpZM4R-06T.

valeriansaliou commented 6 years ago

Thanks. Accepted your MR anyway, that's probably the best way to do it.

Just released v2.1.6 on Crates.io.

rohitjoshi commented 6 years ago

Thanks šŸ‘