MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / app_id_of

Function app_id_of

vmm/src/main_service.rs:46–55  ·  view source on GitHub ↗
(compose_file: &str)

Source from the content-addressed store, hash-verified

44}
45
46fn app_id_of(compose_file: &str) -> String {
47 fn truncate40(s: &str) -> &str {
48 if s.len() > 40 {
49 &s[..40]
50 } else {
51 s
52 }
53 }
54 truncate40(&hex_sha256(compose_file)).to_string()
55}
56
57/// Validate the VM label, restricting it to a safe character set to prevent injection vectors.
58fn validate_label(label: &str) -> Result<()> {

Callers 2

update_vmMethod · 0.85

Calls 2

truncate40Function · 0.85
hex_sha256Function · 0.85

Tested by

no test coverage detected