aboutsummaryrefslogtreecommitdiff
path: root/core/src/util/mod.rs
blob: a3c3f506bab4de94cce96395d1e18b8a6d76387c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
mod decode;
mod encode;
mod path;

pub use decode::decode;
pub use encode::{encode, encode_into_slice};
pub use path::{home_dir, tilde_expand};

use rand::{rngs::OsRng, Rng};

/// Generates and returns a random u32 using `rand::rngs::OsRng`.
pub fn random_32() -> u32 {
    OsRng.gen()
}

/// Generates and returns a random u16 using `rand::rngs::OsRng`.
pub fn random_16() -> u16 {
    OsRng.gen()
}