prolificinteractive / Caishen

A Payment Card UI & Validator for iOS
MIT License
766 stars 119 forks source link

Fixed an issue with 32 bit devices (i.e. iPhone 4S). #20

Closed DannyVancura closed 8 years ago

DannyVancura commented 8 years ago
Haud commented 8 years ago

This is a clever solution, but couldn't we just use Int or UInt64 instead for just this check?

DannyVancura commented 8 years ago

UInt64 might work. According to ISO/IEC 7812 a number can have up to 19 digits, which can always be represented with an unsigned 64 bit. Personally, I'd prefer a string comparison solution though, as this does not put any constraints on the card number length at all.

JamesJSY commented 8 years ago

:+1: