{"record":{"id":"6cb0de20122ae0de","repo":"jdx/mise","slug":"unknown-checksum-algorithm","errorCode":null,"errorMessage":"Unknown checksum algorithm: {}","messagePattern":"Unknown checksum algorithm: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/hash.rs","lineNumber":130,"sourceCode":"        \"sha224\" => file_hash_prog::<Sha224>(path, pr)?,\n        \"sha384\" => file_hash_prog::<Sha384>(path, pr)?,\n        \"sha1\" => {\n            if use_external_hasher && file::which(\"sha1sum\").is_some() {\n                let out = cmd!(\"sha1sum\", path).read()?;\n                out.split_whitespace().next().unwrap().to_string()\n            } else {\n                file_hash_prog::<Sha1>(path, pr)?\n            }\n        }\n        \"md5\" => {\n            if use_external_hasher && file::which(\"md5sum\").is_some() {\n                let out = cmd!(\"md5sum\", path).read()?;\n                out.split_whitespace().next().unwrap().to_string()\n            } else {\n                file_hash_prog::<Md5>(path, pr)?\n            }\n        }\n        _ => bail!(\"Unknown checksum algorithm: {}\", algo),\n    };\n    let checksum = checksum.to_lowercase();\n    if actual != checksum {\n        bail!(\n            \"Checksum mismatch for file {}:\\nExpected: {algo}:{checksum}\\nActual:   {algo}:{actual}\",\n            display_path(path)\n        );\n    }\n    Ok(())\n}\n\npub(crate) fn parse_shasums(text: &str) -> HashMap<String, String> {\n    text.lines()\n        .filter_map(|l| {\n            let mut parts = l.split_whitespace();\n            let hash = parts.next()?;\n            let name = parts.next()?;\n            // Strip coreutils binary-mode marker (e.g. \"<hash> *file.tar.gz\").","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/hash.rs#L112-L148","documentation":"ensure_checksum in src/hash.rs computes a file's digest and compares it to an expected checksum string. The algorithm is selected by matching the prefix before ':' in the checksum; if the named algorithm isn't one of the supported ones (e.g. sha256, sha1, md5), it bails with this error.","triggerScenarios":"Passing a checksum string like 'sha512:...' or a misspelled algorithm ('SHA 256:...', 'sh256:...') to ensure_checksum, which is invoked from checksum verification paths (e.g. corepack checksum tests/verification).","commonSituations":"Typo in the algorithm name in a config or lockfile entry; a tool's published checksum uses an algorithm mise doesn't support; copying a checksum line that includes extra qualifiers.","solutions":["Use a supported algorithm name: sha256, sha384, sha512, sha1, or md5 (lowercase, no spaces) before the colon.","Recompute the digest with sha256sum if the source only publishes an unsupported algorithm, and store that value instead.","Check for typos or stray whitespace in the checksum string in your mise.toml / lockfile."],"exampleFix":"// before (mise.toml)\nchecksum = \"sha512:abc123...\"\n// after\nchecksum = \"sha256:9f2c1a...\"","handlingStrategy":"validation","validationCode":"case \"${checksum%%:*}\" in\n  sha256|sha384|sha512|sha1|md5) echo ok ;;\n  *) echo \"unsupported algorithm: ${checksum%%:*}\" >&2; exit 1 ;;\nesac","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin checksums with sha256 or sha512 only","Lint config checksums for typos/whitespace before running installs","Recompute unsupported-algorithm digests locally with sha256sum and store those"],"tags":["checksum","hashing","validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}