High quality, simple random password generator

前端 未结 27 2471
渐次进展
渐次进展 2020-12-22 17:06

I\'m interested in creating a very simple, high (cryptographic) quality random password generator. Is there a better way to do this?

import os, random, strin         


        
27条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-22 17:08

    This is more for fun than anything. Scores favorably in passwordmeter.com but impossible to remember.

    #!/usr/bin/ruby
    
    puts (33..126).map{|x| ('a'..'z').include?(x.chr.downcase) ?
                           (0..9).to_a.shuffle[0].to_s + x.chr :
                           x.chr}.uniq.shuffle[0..41].join[0..41]
    

提交回复
热议问题