Skip to content

Incorrect decoding issue #1

@JakeRowsell89

Description

@JakeRowsell89

With the following input, decompression is incorrect although still 95% exactly the same. The problem looks like it's a single encoded character being incorrectly decoded. It looks like a burst error.

In lib/input.js inside the readCompressed function it seems like there is a case where the symbol consists of 2 charcodes (you can do symbol.charCodeAt(0) and symbol.charCodeAt(1) with results.

Save this input as a text file and run a compression, then a decompression on that result

This is a string that is to be encoded. Let's see how that works. We can even add extra steps to encode our bits into unicode. This is actually only aesthetic, as javascript string characters are 16 bits per character. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaThis is a string that is to be encoded. Let's see how that works. We can even add extra steps to encode our bits into unicode. This is actually only aesthetic, as javascript string characters are 16 bits per character. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaThis is a string that is to be encoded. Let's see how that works. We can even add extra steps to encode our bits into unicode. This is actually only aesthetic, as javascript string characters are 16 bits per character. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaThis is a string that is to be encoded. Let's see how that works. We can even add extra steps to encode our bits into unicode. This is actually only aesthetic, as javascript string characters are 16 bits per character. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaThis is a string that is to be encoded. Let's see how that works. We can even add extra steps to encode our bits into unicode. This is actually only aesthetic, as javascript string characters are 16 bits per character. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaThis is a string that is to be encoded. Let's see how that works. We can even add extra steps to encode our bits into unicode. This is actually only aesthetic, as javascript string characters are 16 bits per character. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaThis is a string that is to be encoded. Let's see how that works. We can even add extra steps to encode our bits into unicode. This is actually only aesthetic, as javascript string characters are 16 bits per character. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaThis is a string that is to be encoded. Let's see how that works. We can even add extra steps to encode our bits into unicode. This is actually only aesthetic, as javascript string characters are 16 bits per character. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaThis is a string that is to be encoded. Let's see how that works. We can even add extra steps to encode our bits into unicode. This is actually only aesthetic, as javascript string characters are 16 bits per character. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions