{"comment":{"url":"https://api.github.com/repos/filipalexamaria/ALF/comments/16898157","html_url":"https://github.com/filipalexamaria/ALF/commit/7f6a82066be78becd95b782620aeedb224a6909f#commitcomment-16898157","id":16898157,"user":{"login":"filipalexamaria","id":17574734,"avatar_url":"https://avatars.githubusercontent.com/u/17574734?v=3","gravatar_id":"","url":"https://api.github.com/users/filipalexamaria","html_url":"https://github.com/filipalexamaria","followers_url":"https://api.github.com/users/filipalexamaria/followers","following_url":"https://api.github.com/users/filipalexamaria/following{/other_user}","gists_url":"https://api.github.com/users/filipalexamaria/gists{/gist_id}","starred_url":"https://api.github.com/users/filipalexamaria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filipalexamaria/subscriptions","organizations_url":"https://api.github.com/users/filipalexamaria/orgs","repos_url":"https://api.github.com/users/filipalexamaria/repos","events_url":"https://api.github.com/users/filipalexamaria/events{/privacy}","received_events_url":"https://api.github.com/users/filipalexamaria/received_events","type":"User","site_admin":false},"position":null,"line":null,"path":"","commit_id":"7f6a82066be78becd95b782620aeedb224a6909f","created_at":"2016-03-30T15:57:40Z","updated_at":"2016-03-30T15:57:40Z","body":"Credit card numbers follow certain patterns. A credit card must have between 13 and 16 digits. It must start with:\r\n\r\n• 4 for Visa cards\r\n\r\n• 5 for Master cards\r\n\r\n• 37 for American Express cards\r\n\r\nIn 1954, Hans Luhn of IBM proposed an algorithm for validating credit card numbers. The algorithm is useful to determine if a card number is entered correctly or if a credit card is scanned correctly by a scanner. Almost all credit card numbers are generated following this validity check, commonly know as the Luhn check or the Modulus 10 check, which can be described as follows. For illustration, consider the card number 4388576018402625.\r\n\r\nDouble every second digit from right to left. If doubling of a digit results in a 2-digit number, add up the two digits to get a single-digit number.\r\n2 x 2 = 4\r\n\r\n2 x 2 = 4\r\n\r\n4 x 2 = 8\r\n\r\n1 x 2 = 2\r\n\r\n6 x 2 = 12 (1+2= 3)\r\n\r\n5 x 2 = 10 (1+0= 1)\r\n\r\n8 x 2 = 16 (1+6= 7)\r\n\r\n4 x 2 = 8\r\n\r\nAdd all the single digit numbers from step 1 4 + 4 +8 + 2 +3 + 1 + 7 + 8 = 37\r\n\r\nAdd all digits in the odd places from right to left in the card number\r\n\r\n5 + 6 + 0 + 8 + 0 + 7 + 8 + 3 = 37\r\n\r\nSum the results from step 2 and step 3 37 + 37 = 74\r\n\r\nIf the result from step is divisible by 10, the card number is valid; otherwise, it’s invalid. For example, the number 4388576018402625 is invalid, but the number 4388576018410707 is a valid Visa card; the number 6011000593748745 is invalid, but the number 6011000593748746 is a valid Discover card."}}