Algori...M89_001(3pm)

๐Ÿ“ฆ
version 1.3.6 ยท 5 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

๐Ÿ’– CheckDigits::M89_001 โ€” the "Algori...M89_001(3pm)" girlies' guide ๐Ÿ’–

okay so bestie, welcome to the perl manual page for CheckDigits::M89_001, which is a lil module that computes check digits for a VAT Registration Number (LU). yes, LU as in Luxembourg ๐Ÿ‡ฑ๐Ÿ‡บ. it's giving niche and it's giving essential, and honestly? we're obsessed.


โœจ NAME โœจ

CheckDigits::M89_001 โ€” compute check digits for VAT Registration Number (LU) ๐Ÿ’…


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

like, here's the whole vibe, verbatim:

use Algorithm::CheckDigits;

$ustid = CheckDigits('ustid_lu');

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

$cn = $ustid->complete('136695');
# $cn = '13669580'

$cd = $ustid->checkdigit('13669580');
# $cd = '80'

$bn = $ustid->basenumber('13669580');
# $bn = '136695'

look at that. '136695' goes in, '13669580' comes out. glow up. โœจ


๐ŸŒธ DESCRIPTION ๐ŸŒธ

๐Ÿงฎ ALGORITHM โ€” no cap, it's one step

  1. The checksum is the whole number taken modulo 89.

that's it. that's the algorithm. one line, ate, no crumbs. ๐Ÿ”ฅ

๐Ÿซถ 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.

(not a single thing gets exported, she's private like that ๐Ÿ™ˆ)


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Mathias Weidner, "<mamawe@cpan.org>" โ€” icon, legend, the moment ๐Ÿ’œ


๐ŸŒˆ SEE ALSO ๐ŸŒˆ

  • perl
  • CheckDigits
  • www.pruefziffernberechnung.de

lowkey a reminder bestie: every value you pass in is treated exactly as described above โ€” '' comes back whenever the input isn't purely digits (and spaces, where noted). no improvising, no guessing, that's the rule fr fr ๐Ÿ’€

and that's the whole page, periodt ๐Ÿ’… this lil manual came from User Contributed Perl Documentation and it's riding with perl v5.36.0, dated 2022-10-13 โ€” so if you ever need to cite your source, that's the tea ๐ŸŽ€โœจ

๐Ÿ“ฆ where this page comes from