{"record":{"id":"72a31dcffad696b8","repo":"gchq/CyberChef","slug":"unknown-checksum-algorithm","errorCode":null,"errorMessage":"Unknown checksum algorithm","messagePattern":"Unknown checksum algorithm","errorType":"exception","errorClass":"OperationError","httpStatus":null,"severity":"error","filePath":"src/core/operations/CRCChecksum.mjs","lineNumber":1104,"sourceCode":"            case \"CRC-32/NVME\":              return this.crc(32n, input, 0x1EDC6F41n, 0xFFFFFFFFn, true,  true,  0xFFFFFFFFn);\n            case \"CRC-32/PKZIP\":             return this.crc(32n, input, 0x04C11DB7n, 0xFFFFFFFFn, true,  true,  0xFFFFFFFFn);\n            case \"CRC-32/POSIX\":             return this.crc(32n, input, 0x04C11DB7n, 0x00000000n, false, false, 0xFFFFFFFFn);\n            case \"CRC-32/Q\":                 return this.crc(32n, input, 0x814141ABn, 0x00000000n, false, false, 0x00000000n);\n            case \"CRC-32/SATA\":              return this.crc(32n, input, 0x04C11DB7n, 0x52325032n, false, false, 0x00000000n);\n            case \"CRC-32/V-42\":              return this.crc(32n, input, 0x04C11DB7n, 0xFFFFFFFFn, true,  true,  0xFFFFFFFFn);\n            case \"CRC-32/XFER\":              return this.crc(32n, input, 0x000000AFn, 0x00000000n, false, false, 0x00000000n);\n            case \"CRC-32/XZ\":                return this.crc(32n, input, 0x04C11DB7n, 0xFFFFFFFFn, true,  true,  0xFFFFFFFFn);\n            case \"CRC-40/GSM\":               return this.crc(40n, input, 0x0004820009n, 0x0000000000n, false, false, 0xFFFFFFFFFFn);\n            case \"CRC-64/ECMA-182\":          return this.crc(64n, input, 0x42F0E1EBA9EA3693n, 0x0000000000000000n, false, false, 0x0000000000000000n);\n            case \"CRC-64/GO-ECMA\":           return this.crc(64n, input, 0x42F0E1EBA9EA3693n, 0xFFFFFFFFFFFFFFFFn, true,  true,  0xFFFFFFFFFFFFFFFFn);\n            case \"CRC-64/GO-ISO\":            return this.crc(64n, input, 0x000000000000001Bn, 0xFFFFFFFFFFFFFFFFn, true,  true,  0xFFFFFFFFFFFFFFFFn);\n            case \"CRC-64/MS\":                return this.crc(64n, input, 0x259C84CBA6426349n, 0xFFFFFFFFFFFFFFFFn, true,  true,  0x0000000000000000n);\n            case \"CRC-64/NVME\":              return this.crc(64n, input, 0xAD93D23594C93659n, 0xFFFFFFFFFFFFFFFFn, true,  true,  0xFFFFFFFFFFFFFFFFn);\n            case \"CRC-64/REDIS\":             return this.crc(64n, input, 0xAD93D23594C935A9n, 0x0000000000000000n, true,  true,  0x0000000000000000n);\n            case \"CRC-64/WE\":                return this.crc(64n, input, 0x42F0E1EBA9EA3693n, 0xFFFFFFFFFFFFFFFFn, false, false, 0xFFFFFFFFFFFFFFFFn);\n            case \"CRC-64/XZ\":                return this.crc(64n, input, 0x42F0E1EBA9EA3693n, 0xFFFFFFFFFFFFFFFFn, true,  true,  0xFFFFFFFFFFFFFFFFn);\n            case \"CRC-82/DARC\":              return this.crc(82n, input, 0x0308C0111011401440411n, 0x000000000000000000000n, true, true, 0x000000000000000000000n);\n            default:                         throw new OperationError(\"Unknown checksum algorithm\");\n        }\n    }\n\n}\n\nexport default CRCChecksum;\n","sourceCodeStart":1086,"sourceCodeEnd":1111,"githubUrl":"https://github.com/gchq/CyberChef/blob/4290ea753912378913b1f3f54e0fc5720afeda5d/src/core/operations/CRCChecksum.mjs#L1086-L1111","documentation":"CRCChecksum.run switches over a fixed catalogue of named CRC algorithms. Any algorithm name not present in the case list falls to the default and throws 'Unknown checksum algorithm', because no parameters are defined to compute it.","triggerScenarios":"Calling CRCChecksum.run with args[0] algorithm set to a string that does not match any case label (typo, custom name, case mismatch, or a name from a newer/older catalogue).","commonSituations":"User mistypes the algorithm name; recipe references an algorithm renamed/removed in a different version; localization changed the string.","solutions":["Use one of the documented CRC algorithm names from the catalogue.","For a parameter set not in the catalogue, use the custom CRC entry point instead.","Match the exact case and spelling of the case labels."],"exampleFix":"// before\nalgorithm = 'CRC32'\n// after\nalgorithm = 'CRC-32'","handlingStrategy":"validation","validationCode":"const KNOWN = new Set([/* enumerate case labels, e.g. */ 'CRC-32','CRC-32C','CRC-64/XZ']);\nif (!KNOWN.has(algorithm)) throw new Error('Unknown CRC algorithm');","typeGuard":"function isKnownCrc(name, knownSet) { return knownSet.has(name); }","tryCatchPattern":"try { crc.run(input, [algorithm]); }\ncatch (e) { if (/Unknown checksum algorithm/.test(e.message)) { /* offer custom CRC path */ } else throw e; }","preventionTips":["Select algorithms from the catalogue list, not free text.","For custom parameters use the custom CRC entry point.","Match exact spelling and case of case labels."],"tags":["crc","validation","algorithm","checksum"],"backgroundTag":null,"analyzedSha":"4290ea753912378913b1f3f54e0fc5720afeda5d","analyzedAt":"2026-08-13T06:05:50.210Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}