@@ 388-396 (lines=9) @@ | ||
385 | weightSumC = 0, |
|
386 | weightK = 1, // start at 1 because the right-most character is "C" checksum |
|
387 | weightSumK = 0; |
|
388 | for(i=code.length-1; i>=0; i--){ |
|
389 | weightC = weightC == 20 ? 1 : weightC + 1; |
|
390 | weightK = weightK == 15 ? 1 : weightK + 1; |
|
391 | ||
392 | index = table.indexOf( code.charAt(i) ); |
|
393 | ||
394 | weightSumC += weightC * index; |
|
395 | weightSumK += weightK * index; |
|
396 | } |
|
397 | ||
398 | var c = weightSumC % 47; |
|
399 | weightSumK += c; |
|
@@ 294-302 (lines=9) @@ | ||
291 | weightSumC = 0, |
|
292 | weightK = 1, // start at 1 because the right-most character is "C" checksum |
|
293 | weightSumK = 0; |
|
294 | for(i=code.length-1; i>=0; i--){ |
|
295 | weightC = weightC == 10 ? 1 : weightC + 1; |
|
296 | weightK = weightK == 10 ? 1 : weightK + 1; |
|
297 | ||
298 | index = table.indexOf( code.charAt(i) ); |
|
299 | ||
300 | weightSumC += weightC * index; |
|
301 | weightSumK += weightK * index; |
|
302 | } |
|
303 | ||
304 | var c = weightSumC % 11; |
|
305 | weightSumK += c; |