MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / runtime_cache_key

Function runtime_cache_key

crates/openshell-driver-vm/src/embedded_runtime.rs:127–144  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

125}
126
127fn runtime_cache_key() -> String {
128 let mut fp: u64 = 0;
129 for (index, chunk) in [resources::LIBKRUN, resources::LIBKRUNFW]
130 .into_iter()
131 .chain(std::iter::once(resources::GVPROXY))
132 .enumerate()
133 {
134 let sample = &chunk[..chunk.len().min(64)];
135 let mut word: u64 = 0;
136 for (offset, byte) in sample.iter().enumerate() {
137 word ^= u64::from(*byte) << ((offset % 8) * 8);
138 }
139 let index_u32 = u32::try_from(index).unwrap_or(u32::MAX);
140 fp ^= word.rotate_left(index_u32 * 13 + 7);
141 fp ^= (chunk.len() as u64).rotate_left(index_u32 * 17 + 3);
142 }
143 format!("{VERSION}-{fp:016x}")
144}
145
146fn runtime_cache_dir() -> Result<PathBuf, String> {
147 let base =

Callers 1

ensure_runtime_extractedFunction · 0.85

Calls 1

lenMethod · 0.80

Tested by

no test coverage detected