Crates.io | person |
lib.rs | person |
version | 0.1.0 |
source | src |
created_at | 2024-06-04 00:28:24.465699 |
updated_at | 2024-06-04 00:28:24.465699 |
description | Random identity generator for Rust |
homepage | |
repository | https://github.com/evil-personified/person.rs |
max_upload_size | |
id | 1260598 |
size | 3,625,983 |
This crate allows you to create random and unique identities. This crate is also not fully optimized for speed, PRs are welcome.
Simply create a random identity by calling the Person::random
function:
use person::Person;
let person = Person::random();
Create a random person that's legally allowed to drink:
use chrono::{Duration, Utc};
use person::Person;
// We're using 366 days as a year here to account for leap years and
// to make sure the person is at least 21 years old.
let person = Person::random_with_dob_range(
Utc::now() - Duration::days(366 * 40),
Utc::now() - Duration::days(366 * 21),
);
Or check out what this person might pick as their social media username:
use person::Person;
println!("{}", Person::random().get_random_username());