.\" Automatically generated by Pod::Man 2.1801 (Pod::Simple 3.05) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "CheckDigits 3pm" .TH CheckDigits 3pm "2008-06-06" "perl v5.10.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Algorithm::CheckDigits \- Perl extension to generate and test check digits .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& perl \-MAlgorithm::CheckDigits \-e Algorithm::CheckDigits::print_methods .Ve .PP or .PP .Vb 1 \& use Algorithm::CheckDigits; \& \& @ml = Algorithm::CheckDigits\->method_list(); \& \& $isbn = CheckDigits(\*(AqISBN\*(Aq); \& \& if ($isbn\->is_valid(\*(Aq3\-930673\-48\-7\*(Aq)) { \& # do something \& } \& \& $cn = $isbn\->complete(\*(Aq3\-930673\-48\*(Aq); # $cn = \*(Aq3\-930673\-48\-7\*(Aq \& \& $cd = $isbn\->checkdigit(\*(Aq3\-930673\-48\-7\*(Aq); # $cd = \*(Aq7\*(Aq \& \& $bn = $isbn\->basenumber(\*(Aq3\-930673\-48\-7\*(Aq); # $bn = \*(Aq3\-930673\-48\*(Aq .Ve .SH "ABSTRACT" .IX Header "ABSTRACT" This module provides a number of methods to test and generate check digits. For more information have a look at the web site \&\fIwww.pruefziffernberechnung.de\fR (german). .SH "SUBROUTINES/METHODS" .IX Header "SUBROUTINES/METHODS" .SS "CheckDigits($method)" .IX Subsection "CheckDigits($method)" Returns an object of an appropriate Algorithm::CheckDigits class for the given algorithm. .PP Dies with an error message if called with an unknown algorithm. .PP See below for the available algorithms. Every object understands the following methods: .IP "is_valid($number)" 4 .IX Item "is_valid($number)" Returns true or false if \f(CW$number\fR contains/contains no valid check digit. .IP "complete($number)" 4 .IX Item "complete($number)" Returns a string representation of \f(CW$number\fR completed with the appropriate check digit. .IP "checkdigit($number)" 4 .IX Item "checkdigit($number)" Extracts the check digit from \f(CW$number\fR if \f(CW$number\fR contains a valid check digit. .IP "basenumber($number)" 4 .IX Item "basenumber($number)" Extracts the basenumber from \f(CW$number\fR if \f(CW$number\fR contains a valid check digit. .SS "\fIAlgorithm::CheckDigits::method_list()\fP" .IX Subsection "Algorithm::CheckDigits::method_list()" Returns a list of known methods for check digit computation. .SS "\fIAlgorithm::CheckDigits::print_methods()\fP" .IX Subsection "Algorithm::CheckDigits::print_methods()" Returns a list of known methods for check digit computation. .PP You may use the following to find out which methods your version of Algorithm::CheckDigits provides and where to look for further information. .PP .Vb 1 \& perl \-MAlgorithm::CheckDigits \-e Algorithm::CheckDigits::print_methods .Ve .SS "\s-1CHECK\s0 \s-1SUM\s0 \s-1METHODS\s0" .IX Subsection "CHECK SUM METHODS" At the moment these methods to compute check digits are provided: (vatrn \- \s-1VAT\s0 Return Number, in german ustid UmsatzSTeuer-ID) .IP "m07\-001" 4 .IX Item "m07-001" See Algorithm::CheckDigits::M07_001. .IP "euronote, m09\-001" 4 .IX Item "euronote, m09-001" European bank notes, see Algorithm::CheckDigits::M09_001. .IP "amex, bahncard, diners, discover, enroute, eurocard, happydigits, isin, jcb, klubkarstadt, mastercard, miles&more, visa, m09\-001, imei, imeisv" 4 .IX Item "amex, bahncard, diners, discover, enroute, eurocard, happydigits, isin, jcb, klubkarstadt, mastercard, miles&more, visa, m09-001, imei, imeisv" See Algorithm::CheckDigits::M10_001. .IP "siren, siret, m10\-002" 4 .IX Item "siren, siret, m10-002" See Algorithm::CheckDigits::M10_002. .IP "ismn, m10\-003" 4 .IX Item "ismn, m10-003" See Algorithm::CheckDigits::M10_003. .IP "ean, iln, isbn13, nve, 2aus5, m10\-004" 4 .IX Item "ean, iln, isbn13, nve, 2aus5, m10-004" See Algorithm::CheckDigits::M10_004. .IP "identcode_dp, leitcode_dp, m10\-005" 4 .IX Item "identcode_dp, leitcode_dp, m10-005" See Algorithm::CheckDigits::M10_005. .IP "rentenversicherung, m10\-006" 4 .IX Item "rentenversicherung, m10-006" See Algorithm::CheckDigits::M10_006. .IP "sedol, m10\-008" 4 .IX Item "sedol, m10-008" See Algorithm::CheckDigits::M10_008. .IP "betriebsnummer, m10\-009" 4 .IX Item "betriebsnummer, m10-009" See Algorithm::CheckDigits::M10_009. .IP "postscheckkonti, m10\-010" 4 .IX Item "postscheckkonti, m10-010" See Algorithm::CheckDigits::M10_010. .IP "ups, m10\-011" 4 .IX Item "ups, m10-011" See Algorithm::CheckDigits::M10_011. .IP "hkid, isbn, issn, nhs_gb, ustid_pt, vat_sl, wagonnr_br, m11\-001" 4 .IX Item "hkid, isbn, issn, nhs_gb, ustid_pt, vat_sl, wagonnr_br, m11-001" See Algorithm::CheckDigits::M11_001. .IP "pzn, m11\-002" 4 .IX Item "pzn, m11-002" See Algorithm::CheckDigits::M11_002. .IP "pkz, m11\-003" 4 .IX Item "pkz, m11-003" See Algorithm::CheckDigits::M11_003. .IP "cpf, titulo_eleitor, m11\-004" 4 .IX Item "cpf, titulo_eleitor, m11-004" See Algorithm::CheckDigits::M11_004. .IP "ccc_es, m11\-006" 4 .IX Item "ccc_es, m11-006" See Algorithm::CheckDigits::M11_006. .IP "ustid_fi, vatrn_fi, m11\-007" 4 .IX Item "ustid_fi, vatrn_fi, m11-007" See Algorithm::CheckDigits::M11_007. .IP "ustid_dk, vatrn_dk, m11\-008" 4 .IX Item "ustid_dk, vatrn_dk, m11-008" See Algorithm::CheckDigits::M11_008. .IP "nric_sg, m11\-009" 4 .IX Item "nric_sg, m11-009" See Algorithm::CheckDigits::M11_009. .IP "ahv_ch, m11\-010" 4 .IX Item "ahv_ch, m11-010" See Algorithm::CheckDigits::M11_010. .IP "ustid_nl, vatrn_nl, m11\-011" 4 .IX Item "ustid_nl, vatrn_nl, m11-011" See Algorithm::CheckDigits::M11_011. .IP "bwpk_de, m11\-012" 4 .IX Item "bwpk_de, m11-012" See Algorithm::CheckDigits::M11_012. .IP "ustid_gr, vatrn_gr, m11\-013" 4 .IX Item "ustid_gr, vatrn_gr, m11-013" See Algorithm::CheckDigits::M11_013. .IP "esr5_ch, m11\-015" 4 .IX Item "esr5_ch, m11-015" See Algorithm::CheckDigits::M11_015. .IP "ustid_pl, vatrn_pl, m11\-016" 4 .IX Item "ustid_pl, vatrn_pl, m11-016" See Algorithm::CheckDigits::M11_016. .IP "ecno, ec-no, einecs, elincs, m11\-017" 4 .IX Item "ecno, ec-no, einecs, elincs, m11-017" See Algorithm::CheckDigits::M11_017. .IP "isan, m16\-001" 4 .IX Item "isan, m16-001" See Algorithm::CheckDigits::M16_001. .IP "dni_es, m23\-001" 4 .IX Item "dni_es, m23-001" See Algorithm::CheckDigits::M23_001. .IP "ustid_ie, vatrn_ie, m23\-002" 4 .IX Item "ustid_ie, vatrn_ie, m23-002" See Algorithm::CheckDigits::M23_002. .IP "code_39, m43\-001" 4 .IX Item "code_39, m43-001" See Algorithm::CheckDigits::M43_001. .IP "ustid_lu, vatrn_lu, m89\-001" 4 .IX Item "ustid_lu, vatrn_lu, m89-001" See Algorithm::CheckDigits::M89_001. .IP "ustid_be, vatrn_be, m97\-001" 4 .IX Item "ustid_be, vatrn_be, m97-001" See Algorithm::CheckDigits::M97_001. .IP "iban, m97\-002" 4 .IX Item "iban, m97-002" See Algorithm::CheckDigits::M97_002. .IP "upc, mbase\-001" 4 .IX Item "upc, mbase-001" See Algorithm::CheckDigits::MBase_001. .IP "blutbeutel, bzue_de, ustid_de, vatrn_de, mbase\-002" 4 .IX Item "blutbeutel, bzue_de, ustid_de, vatrn_de, mbase-002" See Algorithm::CheckDigits::MBase_002. .IP "sici, mbase\-003" 4 .IX Item "sici, mbase-003" See Algorithm::CheckDigits::MBase_003. .IP "pa_de, mxx\-001" 4 .IX Item "pa_de, mxx-001" See Algorithm::CheckDigits::MXX_001. .IP "cas, mxx\-002" 4 .IX Item "cas, mxx-002" See Algorithm::CheckDigits::MXX_002. .IP "dem, mxx\-003" 4 .IX Item "dem, mxx-003" Old german bank notes (\s-1DEM\s0), see Algorithm::CheckDigits::MXX_003. .IP "ustid_at, vatrn_at, mxx\-004" 4 .IX Item "ustid_at, vatrn_at, mxx-004" See Algorithm::CheckDigits::MXX_004. .IP "esr9_ch, mxx\-005" 4 .IX Item "esr9_ch, mxx-005" See Algorithm::CheckDigits::MXX_005. .IP "verhoeff, mxx\-006" 4 .IX Item "verhoeff, mxx-006" Verhoeff scheme, see Algorithm::CheckDigits::MXX_006 or Algorithm::Verhoeff .SS "\s-1EXPORT\s0" .IX Subsection "EXPORT" None by default. .SH "SEE ALSO" .IX Header "SEE ALSO" perl, \&\fIwww.pruefziffernberechnung.de\fR. .SH "AUTHOR" .IX Header "AUTHOR" Mathias Weidner, .SH "THANKS" .IX Header "THANKS" Petri Oksanen made me aware that CheckDigits('\s-1IMEI\s0') would invoke no test at all since there was no entry for this in the methods hash. .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright 2004\-2006 by Mathias Weidner .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.