sendcipher-core 0.1.3

Core library for encrypted file sharing at sendcipher.com
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* Created on 2025.10.19 */
/* Copyright (c) 2025-2026 Youcef Lemsafer */
/* SPDX-License-Identifier: MIT */

use rand::RngCore;
use crate::error::Error;

pub fn get_rand_bytes(length: usize) -> Result<Vec<u8>, Error> {
    // /!\ Must be a CSPRNG
    let mut rng = rand::thread_rng();
    let mut buf = vec![0u8; length];
    rng.fill_bytes(&mut buf);
    Ok(buf)
}