kjdev / php-ext-zstd

Zstd Extension for PHP
MIT License
201 stars 27 forks source link

zstd_uncompress error! #13

Open patrickkh7788 opened 5 years ago

patrickkh7788 commented 5 years ago

try use zstd_uncompress with binary file, return false without error message.

the 1.zstd binary is generate from nodejs with https://github.com/Stieneee/node-zstd.git. can be decode with nodejs.

node-zstd encode data can be decode by php-ext-zstd.

patrickkh7788 commented 5 years ago

test this file with zstd binary command, also work.

kjdev commented 5 years ago

php-ext-zstd does not suport streaming. Those compressed with Streaming need to decompress with Streaming.

node-zstd is compressed with Streaming.

if (dict != NULL && dictSize > 0) {
  ZSTD_initCStream_usingDict(zcs, dict, dictSize, level);
} else {
  ZSTD_initCStream(zcs, level);
}

TODO: Streaming support of php-ext-zstd

kjdev commented 5 years ago

6231a4756ae09116c331271948416f5c0cd3f495 Updated so that things compressed by streaming can be decompressed.