Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compress - Decompress not equal #19

Open
mrjasan opened this issue Dec 6, 2017 · 3 comments
Open

Compress - Decompress not equal #19

mrjasan opened this issue Dec 6, 2017 · 3 comments

Comments

@mrjasan
Copy link

mrjasan commented Dec 6, 2017

I have been using the lib for a long time. Nothing but praise.

However, this happens:
LZString.CompressToBase64("1-1072")
// "IwWmAYHYCYA="

LZString.DecompressFromBase64("IwWmAYHYCYA=")
// null

I tried to debug the process and I couldn't find out what could be wrong.

@christianrondeau
Copy link
Collaborator

I won't be able to test that right away, can you check if https://github.com/pieroxy/lz-string behaves in the same way?

@mrjasan
Copy link
Author

mrjasan commented Dec 7, 2017

I tried the same string with the JS lib and it does work as expected.

@christianrondeau
Copy link
Collaborator

Damn. To be completely honest, I don't master the compression algorithm itself. My best idea would be to follow both algorithm and figure out where they start to differ. That's a painful process, and one that I won't be able to do in the very short term; if you're in a rush, that's what I would suggest that you do first.

If you want to reduce the area of failure, you can try the UTF16 Compress/Decompress version for that very string, if it works, that would mean the problem is in the base 64 decoding itself.

When I have time, I'll see if I can spend some time looking into this. Sorry I can't provide faster help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants