1Algorithm::CheckDigits:U:sMe1r0_C0o0n6t(r3ipbmu)ted PerlAlDgoocruimtehnmt:a:tCihoenckDigits::M10_006(3pm)
2
3
4

NAME

6       CheckDigits::M10_006 - compute check digits for Rentenversicherung (DE)
7

SYNOPSIS

9         use Algorithm::CheckDigits;
10
11         $rv = CheckDigits('rentenversicherung');
12
13         if ($rv->is_valid('65180539W001')) {
14               # do something
15         }
16
17         $cn = $rv->complete('65180539W00');
18         # $cn = '65180539W001'
19
20         $cd = $rv->checkdigit('65180539W001');
21         # $cd = '1'
22
23         $bn = $rv->basenumber('65180539W001');
24         # $bn = '65180539W00'
25

DESCRIPTION

27   ALGORITHM
28       1.  The letter is replaced with a two-figure number appropriate to the
29           position of the letter in the german alphabet.
30
31       2.  Beginning left all numbers are weighted with
32           2,1,2,5,7,1,2,1,2,1,2,1.
33
34       3.  The the total of the digits of all products is computed.
35
36       4.  The check digit is sum from step 3 taken modulo 10.
37
38   METHODS
39       is_valid($number)
40           Returns true only if $number consists solely of numbers and the
41           last digit is a valid check digit according to the algorithm given
42           above.
43
44           Returns false otherwise,
45
46       complete($number)
47           The check digit for $number is computed and concatenated to the end
48           of $number.
49
50           Returns the complete number with check digit or '' if $number does
51           not consist solely of digits and spaces.
52
53       basenumber($number)
54           Returns the basenumber of $number if $number has a valid check
55           digit.
56
57           Return '' otherwise.
58
59       checkdigit($number)
60           Returns the checkdigit of $number if $number has a valid check
61           digit.
62
63           Return '' otherwise.
64
65   EXPORT
66       None by default.
67

AUTHOR

69       Mathias Weidner, "<mamawe@cpan.org>"
70

SEE ALSO

72       perl, CheckDigits, www.pruefziffernberechnung.de.
73
74
75
76perl v5.38.0                      2023-07-2A0lgorithm::CheckDigits::M10_006(3pm)
Impressum