Skip to content

Commit

Permalink
💄format code
Browse files Browse the repository at this point in the history
  • Loading branch information
fcurella committed Mar 5, 2025
1 parent cfb6ee4 commit 7f6700e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
18 changes: 6 additions & 12 deletions faker/providers/misc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,10 @@ def binary(self, length: int = (1 * 1024 * 1024)) -> bytes:
return os.urandom(length)

@overload
def md5(self, raw_output: Literal[True]) -> bytes:
...
def md5(self, raw_output: Literal[True]) -> bytes: ...

@overload
def md5(self, raw_output: Literal[False]) -> str:
...
def md5(self, raw_output: Literal[False]) -> str: ...

def md5(self, raw_output: bool = False) -> Union[bytes, str]:
"""Generate a random MD5 hash.
Expand All @@ -83,12 +81,10 @@ def md5(self, raw_output: bool = False) -> Union[bytes, str]:
return res.hexdigest()

@overload
def sha1(self, raw_output: Literal[True]) -> bytes:
...
def sha1(self, raw_output: Literal[True]) -> bytes: ...

@overload
def sha1(self, raw_output: Literal[False]) -> str:
...
def sha1(self, raw_output: Literal[False]) -> str: ...

def sha1(self, raw_output: bool = False) -> Union[bytes, str]:
"""Generate a random SHA-1 hash.
Expand All @@ -105,12 +101,10 @@ def sha1(self, raw_output: bool = False) -> Union[bytes, str]:
return res.hexdigest()

@overload
def sha256(self, raw_output: Literal[True]) -> bytes:
...
def sha256(self, raw_output: Literal[True]) -> bytes: ...

@overload
def sha256(self, raw_output: Literal[False]) -> str:
...
def sha256(self, raw_output: Literal[False]) -> str: ...

def sha256(self, raw_output: bool = False) -> Union[bytes, str]:
"""Generate a random SHA-256 hash.
Expand Down
8 changes: 8 additions & 0 deletions faker/proxy.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2214,6 +2214,7 @@ class Faker:
:sample: raw_output=True
"""
...

@overload
def md5(self, raw_output: Literal[False]) -> str:
"""
Expand Down Expand Up @@ -2314,6 +2315,7 @@ class Faker:
:sample: raw_output=True
"""
...

@overload
def sha256(self, raw_output: Literal[False]) -> str:
"""
Expand Down Expand Up @@ -4295,6 +4297,12 @@ class Faker:
"""
...

def snils(self) -> str:
"""
Returns SNILS number (ru. СНИЛС).
"""
...

def middle_name_female(self) -> str: ...
def middle_name_male(self) -> str: ...
def org_and_vat_id(self, long: bool = ..., dash: bool = ...) -> Tuple[str, str]:
Expand Down

0 comments on commit 7f6700e

Please sign in to comment.