mirror of
https://github.com/michivonah/bbzw-horizon.git
synced 2025-12-22 17:16:27 +01:00
implement substition
This commit is contained in:
parent
b0d0f7ab5f
commit
cd80cfd77a
3 changed files with 66 additions and 49 deletions
|
|
@ -8,4 +8,8 @@ def hash_password(password: str) -> str:
|
|||
|
||||
def generate_new_token(length: int = 32) -> str:
|
||||
"""Generiert einen neuen sicheren Token."""
|
||||
return secrets.token_hex(length) # Erzeugt einen sicheren Token
|
||||
return secrets.token_hex(length) # Erzeugt einen sicheren Token
|
||||
|
||||
def substitute_string_reverse(s: str, alphabet: str, key: str) -> str:
|
||||
reverse_map = {k: a for a, k in zip(alphabet, key)}
|
||||
return "".join(reverse_map.get(ch.upper(), ch) for ch in s)
|
||||
Loading…
Add table
Add a link
Reference in a new issue