def crypt_hashpass(cls, username): import crypt secret_salt = SECRET_SEED.translate(None, string.punctuation) password = crypt.crypt(username, secret_salt) if not password: raise Exception("Failed to hash password, check the secret_salt") return password
def salt_hashpass(cls, username): from hashlib import sha256 secret_salt = SECRET_SEED.translate(None, string.punctuation) password = sha256(secret_salt + username).hexdigest() if not password: raise Exception("Failed to hash password, check the secret_salt") return password