Last active
January 3, 2016 15:19
-
-
Save JonCanning/8482165 to your computer and use it in GitHub Desktop.
Random user data
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
open System | |
let random low hi len = | |
let random = Random() | |
seq {for i in 1..len -> char <| random.Next(int low, int hi) } |> String.Concat | |
let text() = | |
random 'a' 'z' 10 | |
let email() = | |
sprintf "%s@%s.com" <| text() <| text() | |
let phone() = | |
random '0' '9' 9 |> sprintf "01%s" | |
let date (lowDate : DateTime) (hiDate : DateTime) = | |
let random = Random() | |
let diff = hiDate.Subtract(lowDate).Days | |
let days = random.Next(0, diff) | |
lowDate.AddDays(float days) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment