add hash function to xonshrc

This commit is contained in:
histausse 2022-01-25 07:52:26 +01:00
parent b84d0ff2c5
commit 2b65967dd1
Signed by: histausse
GPG key ID: 67486F107F62E9E9

View file

@ -74,3 +74,11 @@ def plot(f, a:float=0.0, b:float=10.0, n:int=300):
plt.plot(x, list(map(f, x)))
plt.show()
import hashlib
def md5(val:str=None)->str:
if val is None:
val = input("Value: ")
val = val.encode()
return hashlib.md5(val).hexdigest()