gchq/CyberChef · error · OperationError

Unknown checksum algorithm

Error message

Unknown checksum algorithm

What it means

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.

Source

Thrown at src/core/operations/CRCChecksum.mjs:1104

            case "CRC-32/NVME":              return this.crc(32n, input, 0x1EDC6F41n, 0xFFFFFFFFn, true,  true,  0xFFFFFFFFn);
            case "CRC-32/PKZIP":             return this.crc(32n, input, 0x04C11DB7n, 0xFFFFFFFFn, true,  true,  0xFFFFFFFFn);
            case "CRC-32/POSIX":             return this.crc(32n, input, 0x04C11DB7n, 0x00000000n, false, false, 0xFFFFFFFFn);
            case "CRC-32/Q":                 return this.crc(32n, input, 0x814141ABn, 0x00000000n, false, false, 0x00000000n);
            case "CRC-32/SATA":              return this.crc(32n, input, 0x04C11DB7n, 0x52325032n, false, false, 0x00000000n);
            case "CRC-32/V-42":              return this.crc(32n, input, 0x04C11DB7n, 0xFFFFFFFFn, true,  true,  0xFFFFFFFFn);
            case "CRC-32/XFER":              return this.crc(32n, input, 0x000000AFn, 0x00000000n, false, false, 0x00000000n);
            case "CRC-32/XZ":                return this.crc(32n, input, 0x04C11DB7n, 0xFFFFFFFFn, true,  true,  0xFFFFFFFFn);
            case "CRC-40/GSM":               return this.crc(40n, input, 0x0004820009n, 0x0000000000n, false, false, 0xFFFFFFFFFFn);
            case "CRC-64/ECMA-182":          return this.crc(64n, input, 0x42F0E1EBA9EA3693n, 0x0000000000000000n, false, false, 0x0000000000000000n);
            case "CRC-64/GO-ECMA":           return this.crc(64n, input, 0x42F0E1EBA9EA3693n, 0xFFFFFFFFFFFFFFFFn, true,  true,  0xFFFFFFFFFFFFFFFFn);
            case "CRC-64/GO-ISO":            return this.crc(64n, input, 0x000000000000001Bn, 0xFFFFFFFFFFFFFFFFn, true,  true,  0xFFFFFFFFFFFFFFFFn);
            case "CRC-64/MS":                return this.crc(64n, input, 0x259C84CBA6426349n, 0xFFFFFFFFFFFFFFFFn, true,  true,  0x0000000000000000n);
            case "CRC-64/NVME":              return this.crc(64n, input, 0xAD93D23594C93659n, 0xFFFFFFFFFFFFFFFFn, true,  true,  0xFFFFFFFFFFFFFFFFn);
            case "CRC-64/REDIS":             return this.crc(64n, input, 0xAD93D23594C935A9n, 0x0000000000000000n, true,  true,  0x0000000000000000n);
            case "CRC-64/WE":                return this.crc(64n, input, 0x42F0E1EBA9EA3693n, 0xFFFFFFFFFFFFFFFFn, false, false, 0xFFFFFFFFFFFFFFFFn);
            case "CRC-64/XZ":                return this.crc(64n, input, 0x42F0E1EBA9EA3693n, 0xFFFFFFFFFFFFFFFFn, true,  true,  0xFFFFFFFFFFFFFFFFn);
            case "CRC-82/DARC":              return this.crc(82n, input, 0x0308C0111011401440411n, 0x000000000000000000000n, true, true, 0x000000000000000000000n);
            default:                         throw new OperationError("Unknown checksum algorithm");
        }
    }

}

export default CRCChecksum;

View on GitHub (pinned to 4290ea7539)

Solutions

  1. Use one of the documented CRC algorithm names from the catalogue.
  2. For a parameter set not in the catalogue, use the custom CRC entry point instead.
  3. Match the exact case and spelling of the case labels.

Example fix

// before
algorithm = 'CRC32'
// after
algorithm = 'CRC-32'
Defensive patterns

Strategy: validation

Validate before calling

const KNOWN = new Set([/* enumerate case labels, e.g. */ 'CRC-32','CRC-32C','CRC-64/XZ']);
if (!KNOWN.has(algorithm)) throw new Error('Unknown CRC algorithm');

Type guard

function isKnownCrc(name, knownSet) { return knownSet.has(name); }

Try / catch

try { crc.run(input, [algorithm]); }
catch (e) { if (/Unknown checksum algorithm/.test(e.message)) { /* offer custom CRC path */ } else throw e; }

Prevention

When it happens

Trigger: 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).

Common situations: User mistypes the algorithm name; recipe references an algorithm renamed/removed in a different version; localization changed the string.

Related errors


AI-assisted analysis of gchq/CyberChef@4290ea7539 (2026-08-13). Data as JSON: /api/errors/72a31dcffad696b8. Report an issue: GitHub.