Description of algorithm for calculation of URN check digit

General remarks

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.

Conversion table for alpha signs

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
01 J25
12 K42
23 L26
34 M27
45 N13
56 O28
67 P29
78 Q31
89 R12
941 S32
A18 T33
B14 U11
C19 V34
D15 W35
E16 X36
F21 Y37
G22 Z38
H23 +49
I24 :17
_ (Underscore)43 - (Minus)39
. (Dot)47 /45

Mathematical algorithm for calculation of URN check digit

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


02.01.2008