Created
September 30, 2010 20:44
-
-
Save polera/605285 to your computer and use it in GitHub Desktop.
This file contains 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
#light | |
open System | |
[<EntryPoint>] | |
let main (args : string[]) = | |
if args.Length <> 1 then | |
failwith "Error: Expected arguments are <password_length>" | |
let password_length = args.[0] | |
let pool2 = List.concat [['a'..'z']; ['A'..'Z']; ['1'..'9']; ['!';'$';'#';'.']] | |
let r = new Random() | |
List.iter (fun elem -> printf "%c" pool2.[r.Next(1, pool2.Length)] ) [1 .. Convert.ToInt32(password_length)] | |
0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment