KubeZero - ZeroDownTime Kubernetes Platform
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

14 lines
315 B

  1. #!/usr/bin/env python3
  2. import bcrypt
  3. import random
  4. import string
  5. chars_fixed = string.ascii_letters + string.digits
  6. passwd = "".join(random.choice(chars_fixed) for x in range(15))
  7. salt = bcrypt.gensalt()
  8. hashed = bcrypt.hashpw(passwd.encode('utf-8'), salt)
  9. print("{}:{}".format(passwd, hashed.decode('utf-8')))