Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

algorithm::checkdigits::mbase_003(3pm) [debian man page]

CheckDigits::MBase_003(3pm)				User Contributed Perl Documentation			       CheckDigits::MBase_003(3pm)

NAME
CheckDigits::MBase_003 - compute check digits for SICI (Serial Item and Contribution Identifier) SYNOPSIS
use Algorithm::CheckDigits; $sici = CheckDigits('sici'); if ($sici->is_valid('0784-8679(20040308)6:<138>2.0.TX;2-H')) { # do something } $cn = $sici->complete('0784-8679(20040308)6:<138>2.0.TX;2-'); # $cn = '0784-8679(20040308)6:<138>2.0.TX;2-H' $cd = $sici->checkdigit('0784-8679(20040308)6:<138>2.0.TX;2-H'); # $cd = 'H' $bn = $sici->basenumber('0784-8679(20040308)6:<138>2.0.TX;2-H'); # $bn = '0784-8679(20040308)6:<138>2.0.TX;2-'; DESCRIPTION
ALGORITHM 0 In the string describing the number all letters (A-Z) are replaced with numbers 10-35 accordingly. All other non-numbers are replaced by 36. 1 Beginning right the numbers at all odd positions are added. 2 The sum from step 1 is multiplied by 3. 3 Beginning right the numbers at all even positions are added. 4 The sums from step 2 and 3 are added. 5 The sum from step 4 is taken modulo 37. 6 The checksum is 37 minus the sum from step 5 where numbers from 10 to 35 are represented by 'A' to 'Z' accordingly and 36 is represented by '#'. METHODS is_valid($number) Returns true only if $number consists solely of numbers and hyphens and the two digits in the middle are valid check digits according to the algorithm given above. Returns false otherwise, complete($number) The check digit for $number is computed and inserted into the middle of $number. Returns the complete number with check digit or '' if $number does not consist solely of digits, hyphens and spaces. basenumber($number) Returns the basenumber of $number if $number has a valid check digit. Return '' otherwise. checkdigit($number) Returns the check digits of $number if $number has valid check digits. Return '' otherwise. EXPORT None by default. AUTHOR
Mathias Weidner, <mathias@weidner.in-bad-schmiedeberg.de> SEE ALSO
perl, CheckDigits, www.pruefziffernberechnung.de, http://sunsite.berkeley.edu/SICI/sici.pdf perl v5.10.0 2008-05-17 CheckDigits::MBase_003(3pm)

Check Out this Related Man Page

CheckDigits::M23_002(3pm)				User Contributed Perl Documentation				 CheckDigits::M23_002(3pm)

NAME
CheckDigits::M23_002 - compute check digits for VAT Registration Number (IE) SYNOPSIS
use Algorithm::CheckDigits; $dni = CheckDigits('ustid_ie'); if ($dni->is_valid('8473625E')) { # do something } $cn = $dni->complete('8473625'); # $cn = '8473625E' $cd = $dni->checkdigit('8473625E'); # $cd = 'E' $bn = $dni->basenumber('8473625E'); # $bn = '8473625' DESCRIPTION
ALGORITHM 1. Beginning right all digits are weighted with their position in the number (i.e. the number left from the check digit is multiplied with 2, the next with 3 and so on). 2. All products are added. 3. The check digit is the sum from step 2 modulo 23. This number is expressed as the corresponding letter from the alphabet where A-V correspond to 1-22 and W stands for check digit 0. METHODS is_valid($number) Returns true only if $number consists solely of numbers and the last digit is a valid check digit according to the algorithm given above. Returns false otherwise, complete($number) The check digit for $number is computed and concatenated to the end of $number. Returns the complete number with check digit or '' if $number does not consist solely of digits and spaces. basenumber($number) Returns the basenumber of $number if $number has a valid check digit. Return '' otherwise. checkdigit($number) Returns the checkdigit of $number if $number has a valid check digit. Return '' otherwise. EXPORT None by default. AUTHOR
Mathias Weidner, <mathias@weidner.in-bad-schmiedeberg.de> SEE ALSO
perl, CheckDigits, www.pruefziffernberechnung.de. perl v5.10.0 2008-05-17 CheckDigits::M23_002(3pm)
Man Page