Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

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

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

NAME
CheckDigits::M10_006 - compute check digits for Rentenversicherung (DE) SYNOPSIS
use Algorithm::CheckDigits; $rv = CheckDigits('rentenversicherung'); if ($rv->is_valid('65180539W001')) { # do something } $cn = $rv->complete('65180539W00'); # $cn = '65180539W001' $cd = $rv->checkdigit('65180539W001'); # $cd = '1' $bn = $rv->basenumber('65180539W001'); # $bn = '65180539W00' DESCRIPTION
ALGORITHM 1. The letter is replaced with a two-figure number appropriate to the position of the letter in the german alphabet. 2. Beginning left all numbers are weighted with 2,1,2,5,7,1,2,1,2,1,2,1. 3. The the total of the digits of all products is computed. 4. The check digit is sum from step 3 taken modulo 10. 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::M10_006(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

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

What can i do to check that the input is all alphabet.. ?

What can i do to check that the input is all alphabet.. ? (4 Replies)
Discussion started by: XXXXXXXXXX
4 Replies

2. Shell Programming and Scripting

script problem

How could I write a script to combine the like check numbers and add their charges, to create one line per check number with a total charge. example of lines: check # check date charge 11211 01/03/06 10.00 11212 01/03/06 ... (3 Replies)
Discussion started by: tdavenpo
3 Replies

3. UNIX for Dummies Questions & Answers

to check if a string has only digits

Hi guys, I am not very experienced in writing ksh scripts and I am trying to write a piece of code that indicates if a given string contains only digits and no alphabet (upper or lower case). If i write it my way it would turn out to have a lot of comparisons.. :eek: Thanks a lot in... (3 Replies)
Discussion started by: lakshmikanth
3 Replies

4. UNIX for Dummies Questions & Answers

Stripping all content but an integer

Hello! I have content in a log file that consists of a lot of spaces before and after a 3 digit integer which I need to strip out before I can use the file. The number of digits can change. When I had my logic in a 'for' loop and could output into another file, it was fine. but it turns out... (10 Replies)
Discussion started by: tekster757
10 Replies

5. Shell Programming and Scripting

why "expr "${REPLY}" : '\([1-9][[:digit:]]*\)" can figure out whether it is a digit?

I found below script to check whether the variable is a digit in ksh. ############################ #!/bin/ksh REPLY="3f" if ]*\)'` != ${REPLY} && "${REPLY}" != "0" ]] then print "is digit\n" else print "not digit\n" fi ############################ Although it works fine, but... (6 Replies)
Discussion started by: sleepy_11
6 Replies

6. Programming

output the letters of the alphabet with the number of occurrences

hi, I'm trying to create a program that will read a file and then check the file for each letter of the alphabet and then output the letter and the number of times it appears in the file, into a new file... this is what i have so far but it's not working.. if anyone could help that would be nice!... (10 Replies)
Discussion started by: svd
10 Replies

7. Programming

Find out 2^n+1 , where n is a 3 digit number

I have to write a c program which takes a 3 digit number n and calculates the value of (2^n)+1 and then determines the number is prime or not. I have tried to first calculate the value of 2^n and then adding one to it and then apply the logic of prime number. but the ultimate problem is that... (7 Replies)
Discussion started by: agrawal.prachi
7 Replies

8. Shell Programming and Scripting

Help with numbers

Say I have 3 sets of numbers: 043 5326 90432 and I want to select the digits that all 3 have in common! so to answer my question 3 is the only digit that all 3 have in common! Can this be done with 1 command in unix shell? or is it more complicated than I think it is? I don't want an answer... (3 Replies)
Discussion started by: puttster
3 Replies

9. Programming

Problem with Sprintf

Hi, I have the below sample code to hash the input number read from file. File will have 16 to 19 digit number and executable hash the number using some logic and returns the hashed value. Each digit in the 16 digit number is converted to a 4 byte value. That if the input is 16digit integer, the... (6 Replies)
Discussion started by: ramkrix
6 Replies

10. Shell Programming and Scripting

change each letter of a string

Is there a way to change each letter of a string to the next one in the alphabet, so that a becomes b and f becomes g, and digits become one unit bigger - 4 becomes 5 and 9 becomes 0. I want to change strings like ben123 to cfo234. (5 Replies)
Discussion started by: locoroco
5 Replies

11. Shell Programming and Scripting

how to delete the line if the first letter is a single digit

Hi, I'm trying to acheive the following, I have a dat file in which i have several addresses, If the address starts with a single digit then i have to delete the line, if it starts with 2 or more digits then i have to keep the line Here is a sample of my file: 377 CARRER DE LA... (5 Replies)
Discussion started by: ramky79
5 Replies

12. Shell Programming and Scripting

Split a file into multiple files based on first two digits of file.

Hi , I do have a fixedwidth flatfile that has data for 10 different datasets each identified by the first two digits in the flatfile. 01 in the first two digit position refers to Set A 02 in the first two digit position refers to Set B and so on I want to genrate 10 different files from my... (6 Replies)
Discussion started by: okkadu
6 Replies

13. Programming

6 digits combination

Is there any program that can create 6 digit numbers with: (DIGIT_1)+(DIGIT_2)+(DIGIT_3)+(DIGIT_4)+(DIGIT_5)+(DIGIT_6)=10 Any perl or C also can. Anyone can help me? Thank you (6 Replies)
Discussion started by: Tzeronone
6 Replies

14. Shell Programming and Scripting

Perl to run different parser based on digit

The perl parser below works as expected assuming the last digit in the NC_ before the . is a single digit. perl -ne 'next if $. == 1; if(/.*del(+)ins(+).*NC_0{4}(+).*g\.(+)_(+)/) # indel { print join("\t", $3, $4, $5, $1, $2), "\n"; } ' out_position.txt > out1.txt ... (8 Replies)
Discussion started by: cmccabe
8 Replies

15. UNIX for Beginners Questions & Answers

List all file whose 3rd char is digit

list all file whose 3rd char is digit (or Nth position is digit) what will be the required command? (5 Replies)
Discussion started by: rahul
5 Replies