/home/cpanrun/depot/main/contrib-patched/perl/CPAN/src/Algorithm-CheckDigits/blib/html/site/lib/Algorithm/CheckDigits/M11_012.html


DESCRIPTION</PRE> <P> <H2><A NAME=``algorithm''>ALGORITHM</A></H2> <OL> <LI> Beginning left all digits are weighted 2,3,4,5,6,7,1,6,7,2,3. Letters are replaced according to the following table: <PRE> my %table_to = ( A =&gt; 12, B =&gt; 14, C =&gt; 16, D =&gt; 18, E =&gt; 20, F =&gt; 22, G =&gt; 24, H =&gt; 26, I =&gt; 28, J =&gt; 6, K =&gt; 8, L =&gt; 10, M =&gt; 12, N =&gt; 14, O =&gt; 16, P =&gt; 18, Q =&gt; 20, R =&gt; 22, S =&gt; 4, T =&gt; 6, U =&gt; 8, V =&gt; 10, W =&gt; 12, X =&gt; 14, Y =&gt; 16, Z =&gt; 18, );</PRE> <P></P> <LI> The weighted digits are added. <P></P> <LI> The sum from step 2 is taken modulo 11. <P></P> <LI> The checksum is 11 minus the sum from step 3. <P>If the difference is 10, the checkdigit is 0.</P> <P>If the difference is 11, the checkdigit is 1.</P> <P></P></OL> <P> <H2><A NAME=``methods''>METHOD/A</H2> <DL> <DT><STRONG><A NAME=``item_is_valid''><CODE>is_valid($number)</CODE></A></STRONG><BR> <DD> Returns true only if <CODE>$number</CODE> consists solely of numbers and hyphens and the two digits in the middle are valid check digits according to the algorithm given above. <P>Returns false otherwise,</P> <P></P> <DT><STRONG><A NAME=``item_complete''><CODE>complete($number)</CODE></A></STRONG><BR> <DD> The check digit for <CODE>$number</CODE> is computed and inserted into the middle of <CODE>$number</CODE>. <P>Returns the complete number with check digit or '' if <CODE>$number</CODE> does not consist solely of digits, hyphens and spaces.</P> <P></P> <DT><STRONG><A NAME=``item_basenumber''><CODE>basenumber($number)</CODE></A></STRONG><BR> <DD> Returns the basenumber of <CODE>$number</CODE> if <CODE>$number</CODE> has a valid check digit. <P>Return '' otherwise.</P> <P></P> <DT><STRONG><A NAME=``item_checkdigit''><CODE>checkdigit($number)</CODE></A></STRONG><BR> <DD> Returns the check digits of <CODE>$number</CODE> if <CODE>$number</CODE> has valid check digits. <P>Return '' otherwise.</P> <P></P></DL> <P> <H2><A NAME=``export''>EXPORT</A></H2> <P>None by default.</P> <P> <HR> <H1><A NAME=``author''>AUTHOR</A></H1> <P>Mathias Weidner, &lt;<A HREF=``mailto:mathias@weidner.in-bad-schmiedeberg.de''>mathias@weidner.in-bad-schmiedeberg.de&gt;</P> <P> <HR> <H1><A NAME=``see also''>SEE ALSO</A></H1> <P><A HREF=``../../../../bin/perl.html''>the perl manpage</A>, <A HREF=``../../../../site/lib/CheckDigits.html''>the CheckDigits manpage</A>, <EM>www.pruefziffernberechnung.de</EM>,</P> <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%> <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR=``#cccccc''> <FONT SIZE=+1><STRONG><P CLASS=block>&nbsp;CheckDigits::M11_012 - compute check digits for Bundeswehrpersonenkennnummer</P></STRONG></FONT> </TD></TR> </TABLE>

</BODY>

</HTML>

 /home/cpanrun/depot/main/contrib-patched/perl/CPAN/src/Algorithm-CheckDigits/blib/html/site/lib/Algorithm/CheckDigits/M11_012.html