BTUIKUtil.h 774 B

12345678910111213141516171819202122232425262728
  1. #import <UIKit/UIKit.h>
  2. @interface BTUIKUtil : NSObject
  3. /// Checks if a card number is Luhn valid
  4. ///
  5. /// @param cardNumber A string of numbers representing the card number
  6. ///
  7. /// @return True ic the cardNumber is Luhn valid. False otherwise.
  8. + (BOOL)luhnValid:(NSString *)cardNumber;
  9. /// Strips non-digit characters from a string.
  10. ///
  11. /// @param input The string to strip.
  12. ///
  13. /// @return The string stripped of non-digit characters, or `nil` if `input` is
  14. /// `nil`
  15. + (NSString *)stripNonDigits:(NSString *)input;
  16. /// Strips non-digit characters and '/' from a string.
  17. ///
  18. /// @param input The string to strip.
  19. ///
  20. /// @return The string stripped of non-digit characters and '/', or `nil` if `input` is
  21. /// `nil`
  22. + (NSString *)stripNonExpiry:(NSString *)input;
  23. @end