pict-rs/src/file_path.rs
asonix d13f7fe969
All checks were successful
/ tests (push) Successful in 2m25s
/ clippy (push) Successful in 2m5s
/ check (aarch64-unknown-linux-musl) (push) Successful in 2m52s
/ check (armv7-unknown-linux-musleabihf) (push) Successful in 2m55s
/ check (x86_64-unknown-linux-musl) (push) Successful in 1m55s
Include a few random bytes in the directory structure
2024-02-27 20:18:35 -06:00

19 lines
361 B
Rust

use std::path::PathBuf;
use uuid::Uuid;
pub(crate) fn generate_disk(mut path: PathBuf) -> PathBuf {
path.extend(generate());
path
}
pub(crate) fn generate_object() -> String {
generate().join("/")
}
fn generate() -> Vec<String> {
let s = Uuid::now_v7().simple().to_string();
(0..10).map(|i| s[i * 2..i * 2 + 2].to_string()).collect()
}