X7ROOT File Manager
Current Path:
/opt/alt/python311/lib/python3.11/site-packages/validators
opt
/
alt
/
python311
/
lib
/
python3.11
/
site-packages
/
validators
/
📁
..
📄
__init__.py
(1.86 KB)
📁
__pycache__
📄
_extremes.py
(1.01 KB)
📄
_tld.txt
(9.4 KB)
📄
between.py
(2.39 KB)
📄
btc_address.py
(1.62 KB)
📄
card.py
(5.63 KB)
📄
country.py
(14.57 KB)
📄
cron.py
(2.23 KB)
📄
domain.py
(2.4 KB)
📄
email.py
(2.72 KB)
📄
encoding.py
(1.34 KB)
📄
finance.py
(3.22 KB)
📄
hashes.py
(3.21 KB)
📄
hostname.py
(4.05 KB)
📁
i18n
📄
iban.py
(1.05 KB)
📄
ip_address.py
(4.34 KB)
📄
length.py
(1.45 KB)
📄
mac_address.py
(865 B)
📄
py.typed
(0 B)
📄
slug.py
(750 B)
📄
uri.py
(1.78 KB)
📄
url.py
(7.23 KB)
📄
utils.py
(3.1 KB)
📄
uuid.py
(1.04 KB)
Editing: encoding.py
"""Encoding.""" # standard import re # local from .utils import validator @validator def base58(value: str, /): """Return whether or not given value is a valid base58 encoding. Examples: >>> base58('14pq6y9H2DLGahPsM4s7ugsNSD2uxpHsJx') # Output: True >>> base58('cUSECm5YzcXJwP') # Output: ValidationError(func=base58, args={'value': 'cUSECm5YzcXJwP'}) Args: value: base58 string to validate. Returns: (Literal[True]): If `value` is a valid base58 encoding. (ValidationError): If `value` is an invalid base58 encoding. """ return re.match(r"^[1-9A-HJ-NP-Za-km-z]+$", value) if value else False @validator def base64(value: str, /): """Return whether or not given value is a valid base64 encoding. Examples: >>> base64('Y2hhcmFjdGVyIHNldA==') # Output: True >>> base64('cUSECm5YzcXJwP') # Output: ValidationError(func=base64, args={'value': 'cUSECm5YzcXJwP'}) Args: value: base64 string to validate. Returns: (Literal[True]): If `value` is a valid base64 encoding. (ValidationError): If `value` is an invalid base64 encoding. """ return ( re.match(r"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$", value) if value else False )
Upload File
Create Folder