Algori...MXX_004(3pm)

πŸ“¦
version 1.3.6 Β· 5 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

okay so bestie, gather round β€” CheckDigits::MXX_004 is the module that computes check digits for VAT RN (AT). that's the Austrian VAT registration number situation, iykyk. it lives in the Algori...MXX_004(3pm) manpage and yes the name is truncated, we don't talk about it πŸ’€


✨ SYNOPSIS ✨

the vibe check, in code:

use Algorithm::CheckDigits;

$vat = CheckDigits('ustid_at');

if ($vat->is_valid('U13585627')) {
      # do something
}

$cn = $vat->complete('U1358562');
# $cn = 'U13585627'

$cd = $vat->checkdigit('U13585627');
# $cd = '7'

$bn = $vat->basenumber('U13585627');
# $bn = 'U1358562'

see how it all just... slays? 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

πŸ”’ ALGORITHM

the whole thing, step by step, no gatekeeping:

  1. Beginning right all numbers before the check digit are weighted alternatively 1 and 2. (so like, from the right, going left, alternating β€” not me thinking that's kind of a serve)
  2. The total of the digits of all products is computed and then subtracted from 96. (96 is the moment)
  3. The check digit is the sum of step 3 taken modulo 10. (yes bestie, it says step 3. in step 3. the manpage said it, i'm just the messenger πŸ’€ keeping it fr fr exactly as written)

πŸŽ€ 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.

periodt. nothing exported unless you ask. πŸ’…


πŸ‘‘ AUTHOR πŸ‘‘

Mathias Weidner, "<mamawe@cpan.org>" β€” absolute main character energy, we love an author credit with an email in quotes πŸ’œ


🌈 SEE ALSO 🌈

  • perl
  • CheckDigits
  • www.pruefziffernberechnung.de

all the lore is right there bestie, go read it 🧚


πŸ’– and that's the page!! brought to you by perl v5.36.0, dated 2022-10-13 β€” yes it's giving vintage but it's still iconic, and it's from the User Contributed Perl Documentation universe (Algori...MXX_004(3pm), we stan a truncated title). thanks for coming to my ted talk, slay safe πŸŽ€βœ¨

πŸ“¦ where this page comes from