-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
β¨ 6.1.0 β¨ automatically detect delimiter β deps added/updated β¨ fernet encrypt/decrypt π€ types added/updated π§ͺ tests added/updated
- Loading branch information
Showing
11 changed files
with
152 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
__version__ = "6.0.0" # pragma: no cover | ||
__author__ = "Hapsida @securisec" # pragma: no cover | ||
__version__ = "6.1.0" # pragma: no cover | ||
__author__ = "@securisec" # pragma: no cover |
Submodule chepy_plugins
updated
3 files
+ β | data/ml_detect_encoding.pth | |
+1 β1 | data/ml_labels.json | |
+2 β0 | data/ml_train/train.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
from typing import List, Union | ||
|
||
|
||
def detect_delimiter( | ||
data: Union[str, bytes], | ||
delimiters: List[Union[str, bytes]] = [ | ||
" ", | ||
";", | ||
".", | ||
"-", | ||
"\\", | ||
":", | ||
"/", | ||
",", | ||
"\n", | ||
"\\x", | ||
"\\0x", | ||
], | ||
default_delimiter: str = " ", | ||
) -> Union[str, bytes, None]: | ||
"""Detect delimiter | ||
Args: | ||
data (Union[str, bytes]): Data | ||
delimiters (List[Union[str, bytes]], optional): Array of delimiters. Defaults to [" ", ";", ".", "-", "\"]. | ||
default_delimiter (str): The default delimiter | ||
Returns: | ||
Union[str, bytes, None]: Delimiter or None if one is not found | ||
""" | ||
is_bytes = False | ||
if isinstance(data, bytes): # pragma: no cover | ||
delimiters = [d.encode() for d in delimiters] | ||
is_bytes = True | ||
|
||
for delimiter in delimiters: | ||
parts = data.split(delimiter) | ||
if len(parts) > 1 and all(part.strip() for part in parts): | ||
return delimiter | ||
|
||
if default_delimiter: # pragma: no cover | ||
return default_delimiter.encode() if is_bytes else default_delimiter | ||
else: | ||
return None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters