diff options
Diffstat (limited to 'contrib/isn/ISMN.h')
| -rw-r--r-- | contrib/isn/ISMN.h | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/contrib/isn/ISMN.h b/contrib/isn/ISMN.h index 0451d1942c..1d7b2af8fd 100644 --- a/contrib/isn/ISMN.h +++ b/contrib/isn/ISMN.h @@ -1,4 +1,4 @@ -/* +/* * ISMN.h * PostgreSQL type definitions for ISNs (ISBN, ISMN, ISSN, EAN13, UPC) * @@ -6,23 +6,23 @@ * http://www.ismn-international.org * * IDENTIFICATION - * $PostgreSQL: pgsql/contrib/isn/ISMN.h,v 1.1 2006/09/09 04:07:52 tgl Exp $ + * $PostgreSQL: pgsql/contrib/isn/ISMN.h,v 1.2 2006/10/04 00:29:45 momjian Exp $ * * M-3452-4680-5 <=> (0)-3452-4680-5 <=> 0345246805 <=> 9790345246805 <=> 979-0-3452-4680-5 * - * (M counts as 3) - * ISMN M 3 4 5 2 4 6 8 0 - * Weight 3 1 3 1 3 1 3 1 3 - * Product 9 + 3 + 12 + 5 + 6 + 4 + 18 + 8 + 0 = 65 - * 65 / 10 = 6 remainder 5 - * Check digit 10 - 5 = 5 + * (M counts as 3) + * ISMN M 3 4 5 2 4 6 8 0 + * Weight 3 1 3 1 3 1 3 1 3 + * Product 9 + 3 + 12 + 5 + 6 + 4 + 18 + 8 + 0 = 65 + * 65 / 10 = 6 remainder 5 + * Check digit 10 - 5 = 5 * => M-3452-4680-5 * - * ISMN 9 7 9 0 3 4 5 2 4 6 8 0 - * Weight 1 3 1 3 1 3 1 3 1 3 1 3 - * Product 9 + 21 + 9 + 0 + 3 + 12 + 5 + 6 + 4 + 18 + 8 + 0 = 95 - * 95 / 10 = 9 remainder 5 - * Check digit 10 - 5 = 5 + * ISMN 9 7 9 0 3 4 5 2 4 6 8 0 + * Weight 1 3 1 3 1 3 1 3 1 3 1 3 + * Product 9 + 21 + 9 + 0 + 3 + 12 + 5 + 6 + 4 + 18 + 8 + 0 = 95 + * 95 / 10 = 9 remainder 5 + * Check digit 10 - 5 = 5 * => 979-0-3452-4680-5 * * Since mod10(9*1 + 7*3 + 9*1 + 0*3) = mod10(M*3) = mod10(3*3) = 9; the check digit remains the same. @@ -31,16 +31,16 @@ /* where the digit set begins, and how many of them are in the table */ const unsigned ISMN_index[10][2] = { - {0, 5}, - {5, 0}, - {5, 0}, - {5, 0}, - {5, 0}, - {5, 0}, - {5, 0}, - {5, 0}, - {5, 0}, - {5, 0}, + {0, 5}, + {5, 0}, + {5, 0}, + {5, 0}, + {5, 0}, + {5, 0}, + {5, 0}, + {5, 0}, + {5, 0}, + {5, 0}, }; const char *ISMN_range[][2] = { {"0-000", "0-099"}, |
