-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: avoid Buffer re-encode during compression (#184)
If the data is already a Buffer then just compress it, don't convert it to a string and back to a Buffer again before compressing it. A test with Buffer input is added. The input is chosen carefully to ensure that if it was assumed to be UTF-8 encoded it would not be the same when decompressed and added an additional assertion for the decompressed data to match the original.
- Loading branch information
Showing
2 changed files
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters