Files
Inventaire-gestion/mkhash.py

14 lines
327 B
Python

#!/usr/bin/env python3
import sys, getpass, bcrypt
def main():
if len(sys.argv) > 1:
password = sys.argv[1]
else:
password = getpass.getpass("Mot de passe: ")
h = bcrypt.hashpw(password.encode("utf-8"), bcrypt.gensalt(rounds=12)).decode("ascii")
print(h)
if __name__ == "__main__":
main()