Skip to content

Commit

Permalink
Update utils_general.py
Browse files Browse the repository at this point in the history
  • Loading branch information
SermetPekin authored Jun 8, 2024
1 parent a1b4a91 commit 6b19d5f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions evdspy/EVDSlocal/utils/utils_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ def encode(text: str) -> bytes:
t_bytes = text.encode("ascii")
encoded = base64.b64encode(t_bytes)
return encoded

def replace_recursive(content: str, char: str, new_char: str):
if char not in content:
return content
content = content.replace(char, new_char)
return replace_recursive(content, char, new_char)

def api_key_looks_valid(key: str):
return isinstance(key, str) and len(key) == 10
class ApiKeyErrorEnvir(BaseException):
Expand Down Expand Up @@ -128,4 +133,4 @@ def get_random_hash(num=5):
import string
letters = string.ascii_letters
randomF = ''.join(random.choice(letters) for i in range(num))
return randomF
return randomF

0 comments on commit 6b19d5f

Please sign in to comment.