25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 
 

17 satır
655 B

  1. import math
  2. def renderPassword(mdp, quotient, alphabet):
  3. if len(mdp) > 14:
  4. return mdp
  5. quotient, remainder = divmod(quotient, len(alphabet))
  6. mdp += alphabet[remainder]
  7. return renderPassword(mdp, quotient, alphabet)
  8. alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
  9. print(renderPassword('', int('dc33d431bce2b01182c613382483ccdb0e2f66482cbba5e9d07dab34acc7eb1e', 16), alphabet))
  10. max_length = math.floor(math.log(int('dc33d431bce2b01182c613382483ccdb0e2f66482cbba5e9d07dab34acc7eb1e', 16))/math.log(26 + 26 + 10 + 32)) - 4
  11. print('max number of char for password with 32 bytes entropy: %d' % max_length)