Skip to content

Instantly share code, notes, and snippets.

@polera
Created September 30, 2010 20:44
Show Gist options
  • Save polera/605285 to your computer and use it in GitHub Desktop.
Save polera/605285 to your computer and use it in GitHub Desktop.
#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