Algori...MXX_004(3pm)
π 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:
- 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)
- The total of the digits of all products is computed and then subtracted from 96. (96 is the moment)
- 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$numberconsists 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$numberis 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$numberif$numberhas a valid check digit.
Return '' otherwise.
checkdigit($number)β Returns the checkdigit of$numberif$numberhas 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 π
perlCheckDigitswww.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
- ubuntu noble: libalgorithm-checkdigits-perl 1.3.6-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libalgorithm-checkdigits-perl 1.3.6-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libalgorithm-checkdigits-perl 1.3.6-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms