<commit_before>#!/usr/bin/env python

import getpass
import argparse
import hashlib
from Crypto.Cipher import AES
from Crypto import Random

argparser = argparse.ArgumentParser(description="Generate password from passphrase")
argparser.add_argument('-l', dest="length", help="Generated password length", default=12)
argparser.add_argument('hint', nargs='*')
args = argparser.parse_args()

key = getpass.getpass()
len = int(args.length)
str = hashlib.sha512(key + args.hint[0]).hexdigest()[:len];

print str
<commit_msg>make it compatible with python 3<commit_after>#!/usr/bin/env python

import getpass
import argparse
import hashlib
from Crypto.Cipher import AES
from Crypto import Random

argparser = argparse.ArgumentParser(description="Generate password from passphrase")
argparser.add_argument('-l', dest="length", help="Generated password length", default=12)
argparser.add_argument('hint', nargs='*')
args = argparser.parse_args()

key = getpass.getpass()
len = int(args.length)
str = hashlib.sha512(key + args.hint[0]).hexdigest()[:len];

print (str)

{'fraction_non_alphanumeric': 0.13220018885741266, 'fraction_numerical': 0.012275731822474031, 'mean_word_length': 6.91044776119403, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2420560', 'n_tokens_mistral': 341, 'n_tokens_neox': 327, 'n_words': 85}