my_random 0.1.1

A random generator thats allows you to create tokens, shuffle, numbers and lots more
Documentation
  • Coverage
  • 0%
    0 out of 15 items documented0 out of 8 items with examples
  • Size
  • Source code size: 8.32 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.53 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 17s Average build duration of successful builds.
  • all releases: 16s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • JadeEmperor02/my_random
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • JadeEmperor02

my_random

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

Features

  • 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.

📦 Usage

add the package to your Cargo toml:

toml
my_random = "0.1.1"

🧪 Examples

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");
}

🎉 Have fun!

Whether you're building a game, a secure app, or just experimenting, my_random makes randomness easy and fun 😁

More Resources