1Algorithm::CheckDigits:U:sMeBrasCeo_n0t0r2i(b3u)ted PerlAlDgoocruimtehnmt:a:tCihoenckDigits::MBase_002(3)
2
3
4

NAME

6       CheckDigits::MBase_002 - compute check digits for blood bags (DE), BZÜ
7       (DE), VAT Registration Number (DE)
8

SYNOPSIS

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

DESCRIPTION

28   ALGORITHM
29       1.  Start with values P = 10, S = 0.
30
31       2.  Beginning left you do the following for all digits
32
33           1.  S = (P + digit) modulo 10
34
35           2.  If S is 0 then S = 10.
36
37           3.  P = (2 * S) modulo 11
38
39       3.  The check digit is (11 - P) modulo 10.
40
41   METHODS
42       is_valid($number)
43           Returns true only if $number consists solely of numbers and the
44           last digit is a valid check digit according to the algorithm given
45           above.
46
47           Returns false otherwise,
48
49       complete($number)
50           The check digit for $number is computed and concatenated to the end
51           of $number.
52
53           Returns the complete number with check digit or '' if $number does
54           not consist solely of digits and spaces.
55
56       basenumber($number)
57           Returns the basenumber of $number if $number has a valid check
58           digit.
59
60           Return '' otherwise.
61
62       checkdigit($number)
63           Returns the checkdigit of $number if $number has a valid check
64           digit.
65
66           Return '' otherwise.
67
68   EXPORT
69       None by default.
70

AUTHOR

72       Mathias Weidner, "<mamawe@cpan.org>"
73

SEE ALSO

75       perl, CheckDigits, www.pruefziffernberechnung.de, www.eurocode.org.
76
77
78
79perl v5.36.0                      2023-01-1A9lgorithm::CheckDigits::MBase_002(3)
Impressum