Skip to content

Commit

Permalink
馃棑 Dec 29, 2021 5:51:16 PM
Browse files Browse the repository at this point in the history
馃攳 added Literal types of some functions
  • Loading branch information
securisec committed Dec 29, 2021
1 parent 70eba2c commit 3840240
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions chepy/core.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, List, Mapping, Tuple, Union, TypeVar
from typing import Any, List, Mapping, Tuple, Union, TypeVar, Literal

jsonpickle: Any

Expand Down Expand Up @@ -64,5 +64,5 @@ class ChepyCore:
def reset(self: ChepyCoreT): ...
def load_command(self: ChepyCoreT): ...
def pretty(self: ChepyCoreT, indent: int=...) -> ChepyCoreT: ...
def plugins(self: ChepyCoreT, enable: str) -> None: ...
def plugins(self: ChepyCoreT, enable: Literal['true', 'false']) -> None: ...
def set_plugin_path(self: ChepyCoreT, path: str) -> None: ...
4 changes: 2 additions & 2 deletions chepy/modules/codetidy.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from ..core import ChepyCore
from typing import Any, TypeVar
from typing import Any, TypeVar, Literal

pydash: Any
CodeTidyT = TypeVar('CodeTidyT', bound='CodeTidy')
Expand All @@ -12,7 +12,7 @@ class CodeTidy(ChepyCore):
def minify_xml(self: CodeTidyT) -> CodeTidyT: ...
def beautify_xml(self: CodeTidyT) -> CodeTidyT: ...
def php_deserialize(self: CodeTidyT) -> CodeTidyT: ...
def to_upper_case(self: CodeTidyT, by: str=...) -> CodeTidyT: ...
def to_upper_case(self: CodeTidyT, by: Literal['all', 'word', 'sentence']=...) -> CodeTidyT: ...
def to_lower_case(self: CodeTidyT) -> CodeTidyT: ...
def to_snake_case(self: CodeTidyT) -> CodeTidyT: ...
def to_camel_case(self: CodeTidyT, ignore_space: bool=...) -> CodeTidyT: ...
Expand Down
10 changes: 5 additions & 5 deletions chepy/modules/compression.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from ..core import ChepyCore
from typing import Any, TypeVar
from typing import Any, TypeVar, Literal

CompressionT = TypeVar('CompressionT', bound='Compression')

Expand All @@ -12,10 +12,10 @@ class Compression(ChepyCore):
def unzip_one(self: CompressionT, file: str, password: str=...) -> CompressionT: ...
def unzip_all(self: CompressionT, password: str=...) -> CompressionT: ...
def create_zip_file(self: CompressionT, file_name: str) -> CompressionT: ...
def tar_list_files(self: CompressionT, mode: str=...) -> CompressionT: ...
def tar_extract_one(self: CompressionT, filename: str, mode: str=...) -> CompressionT: ...
def tar_extract_all(self: CompressionT, mode: str=...) -> CompressionT: ...
def tar_compress(self: CompressionT, filename: str, mode: str=...) -> CompressionT: ...
def tar_list_files(self: CompressionT, mode: Literal["gz", "bz2", "xz", ""]=...) -> CompressionT: ...
def tar_extract_one(self: CompressionT, filename: str, mode: Literal["gz", "bz2", "xz", ""]=...) -> CompressionT: ...
def tar_extract_all(self: CompressionT, mode: Literal["gz", "bz2", "xz", ""]=...) -> CompressionT: ...
def tar_compress(self: CompressionT, filename: str, mode: Literal["gz", "bz2", "xz", ""]=...) -> CompressionT: ...
def gzip_compress(self: CompressionT, file_name: str=...) -> CompressionT: ...
def gzip_decompress(self: CompressionT) -> CompressionT: ...
def bzip_compress(self: CompressionT) -> CompressionT: ...
Expand Down
4 changes: 2 additions & 2 deletions chepy/modules/encryptionencoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import codecs
import itertools
import string
from typing import TypeVar
from typing import Literal, TypeVar

import lazy_import

Expand Down Expand Up @@ -159,7 +159,7 @@ def rot_47(self) -> EncryptionEncodingT:

@ChepyDecorators.call_stack
def xor(
self, key: str, key_type: str = "hex", ascii: bool = False
self, key: str, key_type: Literal['hex', 'utf', 'base64'] = "hex", ascii: bool = False
) -> EncryptionEncodingT:
"""XOR state with a key
Expand Down
20 changes: 10 additions & 10 deletions chepy/modules/encryptionencoding.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from ..core import ChepyCore
from typing import Any, TypeVar
from typing import Any, TypeVar, Literal

jwt: Any
AES: Any
Expand All @@ -16,22 +16,22 @@ class EncryptionEncoding(ChepyCore):
def rotate_bruteforce(self: EncryptionEncodingT) -> EncryptionEncodingT: ...
def rot_13(self: EncryptionEncodingT) -> EncryptionEncodingT: ...
def rot_47(self: EncryptionEncodingT) -> EncryptionEncodingT: ...
def xor(self: EncryptionEncodingT, key: str, key_type: str=..., ascii: bool=...) -> EncryptionEncodingT: ...
def xor(self: EncryptionEncodingT, key: str, key_type: Literal['hex', 'utf', 'base64']=..., ascii: bool=...) -> EncryptionEncodingT: ...
def xor_bruteforce(self: EncryptionEncodingT, length: int=...) -> EncryptionEncodingT: ...
def jwt_decode(self: EncryptionEncodingT) -> EncryptionEncodingT: ...
def jwt_verify(self: EncryptionEncodingT, secret: str, algorithm: list=...) -> EncryptionEncodingT: ...
def jwt_sign(self: EncryptionEncodingT, secret: str, algorithms: str=...) -> EncryptionEncodingT: ...
def jwt_bruteforce(self: EncryptionEncodingT, wordlist: str, b64_encode: bool=..., algorithm: list=...) -> EncryptionEncodingT: ...
def rc4_encrypt(self: EncryptionEncodingT, key: str, hex_key: bool=...) -> EncryptionEncodingT: ...
def rc4_decrypt(self: EncryptionEncodingT, key: str, hex_key: bool=...) -> EncryptionEncodingT: ...
def des_encrypt(self: EncryptionEncodingT, key: str, iv: str=..., mode: str=..., hex_key: bool=..., hex_iv: bool=...) -> EncryptionEncodingT: ...
def des_decrypt(self: EncryptionEncodingT, key: str, iv: str=..., mode: str=..., hex_key: bool=..., hex_iv: bool=...) -> EncryptionEncodingT: ...
def triple_des_encrypt(self: EncryptionEncodingT, key: str, iv: str=..., mode: str=..., hex_key: bool=..., hex_iv: bool=...) -> EncryptionEncodingT: ...
def triple_des_decrypt(self: EncryptionEncodingT, key: str, iv: str=..., mode: str=..., hex_key: bool=..., hex_iv: bool=...) -> EncryptionEncodingT: ...
def aes_encrypt(self: EncryptionEncodingT, key: str, iv: str=..., mode: str=..., hex_key: bool=..., hex_iv: bool=...) -> EncryptionEncodingT: ...
def aes_decrypt(self: EncryptionEncodingT, key: str, iv: str=..., mode: str=..., hex_key: bool=..., hex_iv: bool=...) -> EncryptionEncodingT: ...
def blowfish_encrypt(self: EncryptionEncodingT, key: str, iv: str=..., mode: str=..., hex_key: bool=..., hex_iv: bool=...) -> EncryptionEncodingT: ...
def blowfish_decrypt(self: EncryptionEncodingT, key: str, iv: str=..., mode: str=..., hex_key: bool=..., hex_iv: bool=...) -> EncryptionEncodingT: ...
def des_encrypt(self: EncryptionEncodingT, key: str, iv: str=..., mode: Literal["CBC", "OFB", "CTR", "ECB"]=..., hex_key: bool=..., hex_iv: bool=...) -> EncryptionEncodingT: ...
def des_decrypt(self: EncryptionEncodingT, key: str, iv: str=..., mode: Literal["CBC", "OFB", "CTR", "ECB"]=..., hex_key: bool=..., hex_iv: bool=...) -> EncryptionEncodingT: ...
def triple_des_encrypt(self: EncryptionEncodingT, key: str, iv: str=..., mode: Literal["CBC", "OFB", "CTR", "ECB"]=..., hex_key: bool=..., hex_iv: bool=...) -> EncryptionEncodingT: ...
def triple_des_decrypt(self: EncryptionEncodingT, key: str, iv: str=..., mode: Literal["CBC", "OFB", "CTR", "ECB"]=..., hex_key: bool=..., hex_iv: bool=...) -> EncryptionEncodingT: ...
def aes_encrypt(self: EncryptionEncodingT, key: str, iv: str=..., mode: Literal["CBC", "OFB", "CTR", "ECB", "GCM"]=..., hex_key: bool=..., hex_iv: bool=...) -> EncryptionEncodingT: ...
def aes_decrypt(self: EncryptionEncodingT, key: str, iv: str=..., mode: Literal["CBC", "OFB", "CTR", "ECB", "GCM"]=..., hex_key: bool=..., hex_iv: bool=...) -> EncryptionEncodingT: ...
def blowfish_encrypt(self: EncryptionEncodingT, key: str, iv: str=..., mode: Literal["CBC", "OFB", "CTR", "ECB"]=..., hex_key: bool=..., hex_iv: bool=...) -> EncryptionEncodingT: ...
def blowfish_decrypt(self: EncryptionEncodingT, key: str, iv: str=..., mode: Literal["CBC", "OFB", "CTR", "ECB"]=..., hex_key: bool=..., hex_iv: bool=...) -> EncryptionEncodingT: ...
def vigenere_encode(self: EncryptionEncodingT, key: str) -> EncryptionEncodingT: ...
def vigenere_decode(self: EncryptionEncodingT, key: str) -> EncryptionEncodingT: ...
def affine_encode(self: EncryptionEncodingT, a: int=..., b: int=...) -> EncryptionEncodingT: ...
Expand Down
6 changes: 3 additions & 3 deletions chepy/modules/hashing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Hashing(ChepyCore):
def sha1(self: HashingT) -> HashingT: ...
def sha2_256(self: HashingT) -> HashingT: ...
def sha2_512(self: HashingT) -> HashingT: ...
def sha2_512_truncate(self: HashingT, truncate: int=...) -> HashingT: ...
def sha2_512_truncate(self: HashingT, truncate: Literal[256, 224]=...) -> HashingT: ...
def sha2_384(self: HashingT) -> HashingT: ...
def sha2_224(self: HashingT) -> HashingT: ...
def sha3_512(self: HashingT) -> HashingT: ...
Expand All @@ -43,8 +43,8 @@ class Hashing(ChepyCore):
def shake_256(self: HashingT, size: int=...) -> HashingT: ...
def shake_128(self: HashingT, size: int=...) -> HashingT: ...
def ripemd_160(self: HashingT) -> HashingT: ...
def blake_2b(self: HashingT, bits: int=..., key: bytes=...) -> HashingT: ...
def blake_2s(self: HashingT, bits: int=..., key: bytes=...) -> HashingT: ...
def blake_2b(self: HashingT, bits: Literal[512, 384, 256, 160, 128]=..., key: bytes=...) -> HashingT: ...
def blake_2s(self: HashingT, bits: Literal[256, 160, 128]=..., key: bytes=...) -> HashingT: ...
def crc8_checksum(self: HashingT) -> HashingT: ...
def crc16_checksum(self: HashingT) -> HashingT: ...
def crc32_checksum(self: HashingT) -> HashingT: ...
Expand Down
4 changes: 2 additions & 2 deletions chepy/modules/utils.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from ..core import ChepyCore
from typing import Any, TypeVar, Union
from typing import Any, Literal, TypeVar, Union

UtilsT = TypeVar('UtilsT', bound='Utils')

Expand Down Expand Up @@ -32,7 +32,7 @@ class Utils(ChepyCore):
def unescape_string(self: UtilsT) -> UtilsT: ...
def color_hex_to_rgb(self: UtilsT) -> UtilsT: ...
def diff(self: UtilsT, state: int=..., buffer: int=..., colors: bool=..., swap: bool=...) -> Any: ...
def pad(self: UtilsT, width: int, direction: str=..., char: str=...) -> UtilsT: ...
def pad(self: UtilsT, width: int, direction: Literal['left', 'right']=..., char: str=...) -> UtilsT: ...
def count(self: UtilsT) -> UtilsT: ...
def set(self: UtilsT) -> UtilsT: ...
def regex_to_str(self: UtilsT, all_combo: bool=...) -> UtilsT: ...

0 comments on commit 3840240

Please sign in to comment.