#random #charset #length #string

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

#1212 in Testing

Download history 3969/week @ 2025-06-02 3008/week @ 2025-06-09 2763/week @ 2025-06-16 3494/week @ 2025-06-23 2781/week @ 2025-06-30 3667/week @ 2025-07-07 3313/week @ 2025-07-14 3900/week @ 2025-07-21 4043/week @ 2025-07-28 3522/week @ 2025-08-04 2815/week @ 2025-08-11 3472/week @ 2025-08-18 2484/week @ 2025-08-25 3477/week @ 2025-09-01 3998/week @ 2025-09-08 3005/week @ 2025-09-15

13,176 downloads per month
Used in 52 crates (42 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

~36KB