Last active
          August 9, 2022 21:53 
        
      - 
      
 - 
        
Save andrewh/6475068 to your computer and use it in GitHub Desktop.  
    Password generator using a quantum random number generator
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/usr/bin/env ruby | |
| # qpasswd - password generator from quantum RNG | |
| require 'open-uri' | |
| rng = 'https://qrng.anu.edu.au/wp-content/plugins/colours-plugin/get_block_alpha.php' | |
| ARGV.size < 1 ? pw_size = 16 : pw_size = ARGV[0].to_i | |
| data = open(rng).read.strip.split('') | |
| output = data.sample(pw_size) | |
| puts output.join | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment