1Algorithm::CheckDigits:U:sMe1r1_C0o1n0t(r3i)buted Perl DAolcguomreintthamt:i:oCnheckDigits::M11_010(3)
2
3
4

NAME

6       CheckDigits::M11_010 - compute check digits AHV number (CH)
7

SYNOPSIS

9         use Algorithm::CheckDigits;
10
11         $ahv = CheckDigits('ahv_ch');
12
13         if ($ahv->is_valid('123.45.678.113')) {
14               # do something
15         }
16
17         $cn = $ahv->complete('123.45.678.11');
18         # $cn = '123.45.678.113'
19
20         $cd = $ahv->checkdigit('123.45.678.113');
21         # $cd = '3'
22
23         $bn = $ahv->basenumber('123.45.678.113');
24         # $bn = '123.45.678.11';
25

DESCRIPTION

27   ALGORITHM
28       1.  Beginning left every digit is weighted with 5,4,3,2,7,6,5,4,3,2.
29
30       2.  The weighted digits are added.
31
32       3.  The sum from step 2 is taken modulo 11.
33
34       4.  The checkdigit is 11 minus the sum from step 3. Is the difference
35           10, the number won't be taken. If the difference is 11, the
36           checkdigit is 0.
37
38   METHODS
39       is_valid($number)
40           Returns true only if $number consists solely of numbers and dots
41           and the rightmost digit is a valid check digit according to the
42           algorithm given above.
43
44           Returns false otherwise,
45
46       complete($number)
47           The check digit for $number is computed and appended the end of
48           $number.
49
50           Returns the complete number with check digit or '' if $number does
51           not consist solely of digits and dots.
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 check digits of $number if $number has valid check
61           digits.
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.30.1                      2020-01-29Algorithm::CheckDigits::M11_010(3)
Impressum