{"record":{"id":"e299a3d684ba43d6","repo":"n8n-io/n8n","slug":"unknown-algorithm-algorithm-available-algorith","errorCode":null,"errorMessage":"Unknown algorithm ${algorithm}. Available algorithms are: ${SupportedHashAlgorithms.join()}, and Base64.","messagePattern":"Unknown algorithm (.+?)\\. Available algorithms are: (.+?), and Base64\\.","errorType":"exception","errorClass":"ExpressionExtensionError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/expression-runtime/src/extensions/string-extensions.ts","lineNumber":112,"sourceCode":"\t\tcase 'sha1':\n\t\tcase 'sha224':\n\t\tcase 'sha256':\n\t\tcase 'sha384':\n\t\tcase 'sha512':\n\t\tcase 'sha3':\n\t\t\tconst variant = (\n\t\t\t\t{\n\t\t\t\t\tsha1: 'SHA-1',\n\t\t\t\t\tsha224: 'SHA-224',\n\t\t\t\t\tsha256: 'SHA-256',\n\t\t\t\t\tsha384: 'SHA-384',\n\t\t\t\t\tsha512: 'SHA-512',\n\t\t\t\t\tsha3: 'SHA3-512',\n\t\t\t\t} as const\n\t\t\t)[algorithm];\n\t\t\treturn new SHA(variant, 'TEXT').update(value).getHash('HEX');\n\t\tdefault:\n\t\t\tthrow new ExpressionExtensionError(\n\t\t\t\t`Unknown algorithm ${algorithm}. Available algorithms are: ${SupportedHashAlgorithms.join()}, and Base64.`,\n\t\t\t);\n\t}\n}\n\nfunction isEmpty(value: string): boolean {\n\treturn value === '';\n}\n\nfunction isNotEmpty(value: string): boolean {\n\treturn !isEmpty(value);\n}\n\nfunction length(value: string): number {\n\treturn value.length;\n}\n\nexport function toJsonString(value: string): string {","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/expression-runtime/src/extensions/string-extensions.ts#L94-L130","documentation":"`.hash(algorithm)` supports exactly `md5`, `sha1`, `sha224`, `sha256`, `sha384`, `sha512`, `sha3` (mapped to SHA3-512), and `base64`. The algorithm is lowercased before the switch, so case is not the issue — an unsupported NAME is. Anything else hits the `default` branch and throws, listing the valid set.","triggerScenarios":"`.hash('crc32')`, `.hash('md4')`, `.hash('sha128')`, `.hash('ripemd160')`.","commonSituations":"Asking for a hash n8n does not bundle; typo in the algorithm name; assuming the full jsSHA catalogue is exposed.","solutions":["Use one of the listed algorithms (`md5`, `sha1`, `sha224`, `sha256`, `sha384`, `sha512`, `sha3`, `base64`).","If you need an unsupported digest, compute it in a Code node with `node:crypto`.","For Base64 encoding specifically, pass `'base64'` rather than a hash name."],"exampleFix":"// before\n{{ $json.s.hash('crc32') }}\n// after\n{{ $json.s.hash('sha256') }}","handlingStrategy":"validation","validationCode":"const ALGOS = new Set(['md5','sha1','sha224','sha256','sha384','sha512','sha3','base64']);\nconst algo = String($json.algo || '').toLowerCase();\nif (!ALGOS.has(algo)) {\n  throw new Error(`hash(): unsupported algorithm '${algo}'`);\n}\nreturn $json;","typeGuard":"const isSupportedHash = (a: string): a is 'md5'|'sha1'|'sha224'|'sha256'|'sha384'|'sha512'|'sha3'|'base64' =>\n  ['md5','sha1','sha224','sha256','sha384','sha512','sha3','base64'].includes(a.toLowerCase());","tryCatchPattern":null,"preventionTips":["Use one of md5/sha1/sha224/sha256/sha384/sha512/sha3/base64.","For unsupported digests, compute in a Code node with node:crypto.","Use `'base64'` for encoding rather than a hash name."],"tags":["expression","string","crypto","hash","validation"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}