about summary refs log blame commit diff
path: root/tvix/build/src/oci/mod.rs
blob: a2400c4a6eba3c709f4ebe7752ed01543dbf73c0 (plain) (tree)
1
2
3
4
5
6
7
8
9






                                             

                    


                                                                          


                                                                                     
 
mod bundle;
mod spec;

pub(crate) use bundle::get_host_output_paths;
pub(crate) use bundle::make_bundle;
pub(crate) use spec::make_spec;

use std::path::Path;

/// For a given scratch path, return the scratch_name that's allocated.
// We currently use use lower hex encoding of the b3 digest of the scratch
// path, so we don't need to globally allocate and pass down some uuids.
pub(crate) fn scratch_name(scratch_path: &Path) -> String {
    data_encoding::BASE32
        .encode(blake3::hash(scratch_path.as_os_str().as_encoded_bytes()).as_bytes())
}