Algorithm creating check digit for URN of name space "nbn:de" refers to complete string:
urn:nbn:de:<snid1>-<snid2>-<niss>
The one-digit check digit, called "P", is positioned directly after the last sign of a URN string.
urn:nbn:de:<snid1>-<snid2>-<niss>P
The character set of check digit consists of numbers zero to nine.
In the following concordance, alphanumerical signs are assigned numerical values including "Zero" e.g. in 10, 20 etc. being avoided. Frequently occurring letters e.g. U, R, N etc. are assigned low number values.
Alpha signs | Numerical value | Alpha signs | Numerical value | |
---|---|---|---|---|
0 | 1 | J | 25 | |
1 | 2 | K | 42 | |
2 | 3 | L | 26 | |
3 | 4 | M | 27 | |
4 | 5 | N | 13 | |
5 | 6 | O | 28 | |
6 | 7 | P | 29 | |
7 | 8 | Q | 31 | |
8 | 9 | R | 12 | |
9 | 41 | S | 32 | |
A | 18 | T | 33 | |
B | 14 | U | 11 | |
C | 19 | V | 34 | |
D | 15 | W | 35 | |
E | 16 | X | 36 | |
F | 21 | Y | 37 | |
G | 22 | Z | 38 | |
H | 23 | + | 49 | |
I | 24 | : | 17 | |
_ (Underscore) | 43 | - (Minus) | 39 | |
. (Dot) | 47 | / | 45 |
First, every alpha sign of a URN string must be replaced with numbers. Corresponding number values have to be derived from the concordance table.
Each number of the digit sequence, ascending from left to right, is individually multiplied beginning with one. Afterwards, the sum of each product is formed. Then, the product sum is divided by the last number of the URN digit sequence. The last number before the comma of the quotient is the check digit.
Exmple:
urn:nbn:de:gbv:089-332175294
String is converted into following digit sequence:
1112131713141317151617221434171941394432863415
Product sum (PS) is derived as follows:
PS = 1*1 + 2*1 + 3*1 + 4*2 + 5*1 + 6*3 ... n*m
PS = 4027
Quotient (Q) is derived from division of product sum (PS) by last number of URN digit sequence:
Q = PS / 5
Q = 4027 / 5
Last number of quotient (Q) before comma is check digit (PZ):
Q = 805,4
PZ = 5
URN including the check digit has the following syntax:
urn:nbn:de:gbv:089-3321752945