rdzobot 0.1.0

Modular, but monolithic Matrix bot
Documentation
// SPDX-License-Identifier: AGPL-3.0-or-later
// SPDX-FileCopyrightText: 2025 Wojtek Porczyk <woju@hackerspace.pl>

use rdzobot::utils;

const SECRET_CHARSET: &[u8; 64] =
    b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-";

fn gen_secret(len: usize) -> String {
    let mut secret = String::with_capacity(len);
    let mut random = utils::random();

    for _ in 0..len {
        secret.push(SECRET_CHARSET[(random.next().unwrap() % 64) as usize] as char);
    }

    secret
}

fn main() {
    println!("{}", gen_secret(20));
}