Skip to content

Bug report: A1Z26 Cipher Decode returns wrong type for empty input #2248

@williballenthin

Description

@williballenthin

Describe the bug
The A1Z26 Cipher Decode operation returns an empty array instead of an empty string when given empty input, violating its declared outputType.

src/core/operations/A1Z26CipherDecode.mjs, run() method, lines 78-80

run(input, args) {
    const delim = Utils.charRep(args[0] || "Space");

    if (input.length === 0) {
        return [];
    }
    // ...
}

The operation declares this.outputType = "string", but the early return for empty input returns []. Downstream consumers that expect a string (e.g., chained operations, output rendering) may throw or produce garbled results.

To Reproduce
https://gchq.github.io/CyberChef/#recipe=A1Z26_Cipher_Decode('Space')

Image

Additional context
Suggested fix:

if (input.length === 0) {
    return "";
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions