1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-17 00:07:37 +02:00

initial working x509 cert parser

This commit is contained in:
Kelly Brazil
2022-07-01 15:48:29 -07:00
parent 430385fa63
commit 13388df603
27 changed files with 16863 additions and 9 deletions

View File

@ -140,21 +140,27 @@ def compatibility(mod_name: str, compatible: List, quiet: bool = False) -> None:
])
def has_data(data: str) -> bool:
def has_data(data: Union[str, bytes]) -> bool:
"""
Checks if the input contains data. If there are any non-whitespace
characters then return `True`, else return `False`.
Checks if the string input contains data. If there are any
non-whitespace characters then return `True`, else return `False`.
For bytes, returns True if there is any data.
Parameters:
data: (string) input to check whether it contains data
data: (string, bytes) input to check whether it contains data
Returns:
Boolean True if input string (data) contains non-whitespace
characters, otherwise False
characters, otherwise False. For bytes data, returns
True if there is any data, otherwise False.
"""
return bool(data and not data.isspace())
if isinstance(data, str):
return bool(data and not data.isspace())
return bool(data)
def convert_to_int(value: Union[str, float]) -> Optional[int]: