#random #string #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

#1068 in Algorithms

Download history 2428/week @ 2024-07-19 2694/week @ 2024-07-26 2886/week @ 2024-08-02 3018/week @ 2024-08-09 3252/week @ 2024-08-16 2909/week @ 2024-08-23 2854/week @ 2024-08-30 2506/week @ 2024-09-06 2372/week @ 2024-09-13 3400/week @ 2024-09-20 2582/week @ 2024-09-27 2256/week @ 2024-10-04 2607/week @ 2024-10-11 3219/week @ 2024-10-18 2309/week @ 2024-10-25 2078/week @ 2024-11-01

10,651 downloads per month
Used in 45 crates (37 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