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
Algorithm::CheckDigits::M11_008(3) User Contributed Perl Documentation Algorithm::CheckDigits::M11_008(3)

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

  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';

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).

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.

None by default.

Mathias Weidner, "<mamawe@cpan.org>"

perl, CheckDigits, www.pruefziffernberechnung.de,
2022-04-09 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

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