GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  ALGORITHM::CHECKDIGITS::M11_008 (3)

.ds Aq ’

NAME

CheckDigits::M11_008 - compute check digits for VAT Registration Number (DK)

CONTENTS

SYNOPSIS



  use Algorithm::CheckDigits;

  $ustid = CheckDigits(ustid_dk);

  if ($ustid->is_valid(13585628)) {
        # do something
  }

  $cn = $ustid->complete(1358562);
  # $cn = 13585628

  $cd = $ustid->checkdigit(13585628);
  # $cd = 8

  $bn = $ustid->basenumber(13585628);
  # $bn = 1358562;



DESCRIPTION

    ALGORITHM

1. Beginning left every digit is weighted with 2, 7, 6, 5, 4, 3, 2, 1
2. The weighted digits are added.
3. The sum from step 2 is taken modulo 11.
4. The number is valid if the sum from step 3 is zero (0).

    METHODS

is_valid($number) Returns true only if $number consists solely of numbers and the sum computed according to the algorithm given above is 0.

Returns false otherwise,

complete($number) Returns $number if $number is valid according to the algorithm given above.

Return ’’ otherwise.

basenumber($number) Returns $number if $number is valid according to the algorithm given above.

Return ’’ otherwise.

checkdigit($number) Returns ’’ if $number is valid.

Return undef otherwise.

    EXPORT

None by default.

AUTHOR

Mathias Weidner, <mamawe@cpan.org>

SEE ALSO

perl, CheckDigits, www.pruefziffernberechnung.de,
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 ALGORITHM::CHECKDIGITS::M11_008 (3) 2016-03-17

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.