#random #string #generate #charset #length

random-string

Allows to generate random strings based on a given charset and length

6 releases (3 stable)

1.1.0 Jan 10, 2024
1.0.1 Oct 20, 2023
1.0.0 Jul 3, 2021
0.2.0 Mar 15, 2021
0.1.1 Oct 10, 2020

#1135 in Algorithms

Download history 1676/week @ 2024-03-14 2113/week @ 2024-03-21 2248/week @ 2024-03-28 1750/week @ 2024-04-04 1965/week @ 2024-04-11 2171/week @ 2024-04-18 1942/week @ 2024-04-25 2316/week @ 2024-05-02 2231/week @ 2024-05-09 2370/week @ 2024-05-16 2184/week @ 2024-05-23 2449/week @ 2024-05-30 2527/week @ 2024-06-06 2771/week @ 2024-06-13 2520/week @ 2024-06-20 1980/week @ 2024-06-27

10,359 downloads per month
Used in 47 crates (36 directly)

GPL-3.0-only

6KB
78 lines

random-string

A simple crate that allows you to generate random strings based on a given charset and length.

Usage

Add a dependence in Cargo.toml

[dependencies]
random-string = "1.0"

Example

use random_string::generate;

fn main() {
    let charset = "1234567890";

    println!("[{}]", generate(6, charset));
}

Dependencies

~35KB