kjdev / php-ext-zstd

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

Missing zstd_getFrameContentSize() function #68

Open dehlirious opened 4 months ago

dehlirious commented 4 months ago

Currently, the PHP extension for Zstandard (zstd) is missing the ZSTD_getFrameContentSize function, which is available in the underlying Zstandard library. This function is not only useful for determining the size of the original uncompressed data in a Zstandard-compressed frame but also for reliably whether the data is indeed compressed with Zstandard.

This could be added to help developers avoid errors like these, (during odd circumstances) Warning: zstd_uncompress(): it was not compressed by zstd

Adding it would not only allow developers to determine the size of the original uncompressed data but also reliably detect whether the data is compressed with Zstandard, enhancing the usability and versatility of the PHP extension.

Version Info PHP Version: 8.3.3 Extension Version | 0.13.1 Interface Version | 1.5.4

Thank you for your attention to this matter.