| Crates.io | my_random |
| lib.rs | my_random |
| version | 0.1.1 |
| created_at | 2025-08-02 00:04:46.986303+00 |
| updated_at | 2025-08-03 21:40:19.953853+00 |
| description | A random generator thats allows you to create tokens, shuffle, numbers and lots more |
| homepage | |
| repository | https://github.com/JadeEmperor02/my_random |
| max_upload_size | |
| id | 1777875 |
| size | 8,817 |
my_random is a simple and concise program that allow you to generate a random number mimicking the randrange function in python, by leveraging its clear syntax you can easily generate tokens, shuffled slices, randomized booleans and lots more.
Heres how to use the crate
rand_range() – Generate a random number between two bounds.rand_shuffle() – Shuffle a vector or slice.rand_bool() – Get a random boolean.rand_vector() – Generate a vector of random numbers.rand_token() – Create a random alphanumeric token.rand_float() – Generate a random float.add the package to your Cargo toml:
toml
my_random = "0.1.1"
all done check out some use cases.
Random Number using rand_range:
use my_random::MyRandom;
fn main() {
// the rand_range method is called with teo values a min and a max to get a random number
let mut rng: MyRandom = MyRandom::new();
println!("randomized value {}", rng.rand_range(0, 10));
println!("success");
}
random token generation using rand_token :
use my_random::MyRandom;
fn main() {
// the rand_token is called with a parameter which tells it how long the token has to be
let mut rng: MyRandom = MyRandom::new();
println!("randomized token {}", rng.rand_token(100));
println!("success");
}
Whether you're building a game, a secure app, or just experimenting, my_random makes randomness easy and fun 😁