[solved]-Void Validateluhn Char Identfier Int Checksum Uint8t Status Checksum 0 Status 0 Fixme Writ Q39047791


*/
void
validateLuhn (char *identfier, int *checksum, uint8_t*status)
{
*checksum = 0;
*status = 0;
/* FIXME: Write your code here. */
return;
}
Luhn Checksum Validation (20 points) The Luhn formula is a simple checksum formula used to validate credit card numbers. It was designed to protect against accidental errors: most credit cards and many other government identification numbers use the algorithm as a simple method of distinguishing valid numbers from mistyped or otherwise incorrect numbers. The formula works as follows. Using the original num ber, double the value of every other digit. Then add the values of the individual digits together (if a doubled value now has two digits, add the digits individually). The identification number is valid if the resulting sum is divisible by 10 Check digit 8 7 2 6 4 4 1 6 1 + 1 4 + + 4 4 + 1 + 27 3 (a) Computing the check digit. 1 7 2 4 8 3 6 4 1 + + 4 + 4 3 30 (b) Luhn checksum validation. Fig. 1: The process of creating and validating Luhn checksums. Let’s now walk through both ends of the checksum creation and validation process: computing a check digit and validating the result. Figure 1(a) illustrates the steps involved in computing the check digit. The original number, 176248, is shown in the dashed-line box. Every other digit, starting from the rightmost digit of the original number (which after the addition of the check digit, will be the second rightmost) is doubled. Then each digit is added together. Note that when doubling a digit results in a two-digit number, each of these digits is considered separately. For example, when 7 is doubled to produce 14, it is not 14 that is added to the checksum, but 1 and 4 separately. In our example, the generated checksum is 27; so the check digit is 3 because that’s the 30 h We were unable to transcribe this imageShow transcribed image text Luhn Checksum Validation (20 points) The Luhn formula is a simple checksum formula used to validate credit card numbers. It was designed to protect against accidental errors: most credit cards and many other government identification numbers use the algorithm as a simple method of distinguishing valid numbers from mistyped or otherwise incorrect numbers. The formula works as follows. Using the original num ber, double the value of every other digit. Then add the values of the individual digits together (if a doubled value now has two digits, add the digits individually). The identification number is valid if the resulting sum is divisible by 10 Check digit 8 7 2 6 4 4 1 6 1 + 1 4 + + 4 4 + 1 + 27 3 (a) Computing the check digit. 1 7 2 4 8 3 6 4 1 + + 4 + 4 3 30 (b) Luhn checksum validation. Fig. 1: The process of creating and validating Luhn checksums. Let’s now walk through both ends of the checksum creation and validation process: computing a check digit and validating the result. Figure 1(a) illustrates the steps involved in computing the check digit. The original number, 176248, is shown in the dashed-line box. Every other digit, starting from the rightmost digit of the original number (which after the addition of the check digit, will be the second rightmost) is doubled. Then each digit is added together. Note that when doubling a digit results in a two-digit number, each of these digits is considered separately. For example, when 7 is doubled to produce 14, it is not 14 that is added to the checksum, but 1 and 4 separately. In our example, the generated checksum is 27; so the check digit is 3 because that’s the 30 h
Expert Answer
Answer to */ void validateLuhn (char *identfier, int *checksum, uint8_t *status) { *checksum = 0; *status = 0; /* FIXME: Write yo… . . .
OR

