-
Notifications
You must be signed in to change notification settings - Fork 0
SimpleEncode Hash
Zagir Medzhidov edited this page Feb 22, 2024
·
2 revisions
from SimpleEncoder import SimpleEncode as SE
# or:
# from SimpleEncoder.hash import Hash
str_hashed = SE.Hash(config: Config = Config()).md5(string: str)
# Real Example:
string = "HashMe"
str_hashed = SE.Hash().md5(string)
print(str_hashed)Run it and check out the code!
- config:Config -> The configuration we set up in the last example. Optional
- md5(string: str -> Text for hashing. Required!)
from SimpleEncoder import SimpleEncode as SE
# or:
# from SimpleEncoder.hash import Hash
password_hashed = SE.Hash(config: Config = Config()).password(string: str)
# Real Example:
string = "Im.Password.HashMe"
password_hashed = SE.Hash().password(string)
print(password_hashed)Run it and check out the code!
- config:Config -> The configuration we set up in the last example. Optional
- password(string: str -> Password for hashing. Required!)
from SimpleEncoder import SimpleEncode as SE
# or:
# from SimpleEncoder.hash import Hash
password_hashed = SE.Hash(config: Config = Config()).password_equals(password:str, string: str)
# Real Example:
string = "Im.Password.HashMe"
invalidPassword = "Im_Password_HashMe"
hash = SE.Hash()
password_hashed = hash().password(string)
password_equals = hash().password_equals(password_hashed, string)
print(password_equals) # True!
password_equals = hash().password_equals(password_hashed, invalidPassword)
print(password_equals) # False!Run it and check out the code!
- config:Config -> The configuration we set up in the last example. Optional
- password(password: str -> A password that is hashed. Required!)
- password(string: str -> Password for hashing and check equals. Required!)