Compressing Buffer/Uint8Array
See original GitHub issueI like this library for its size and want to use for compressing WebRTC data channel traffic.
The issue is that I’m working with Buffer
objects (same as Uint8Array
basically) and this library doesn’t seem to support this.
I understand that library name contains string
in its name, but could you probably add support for mentioned binary objects?
My current workaround is buffer.toString('hex')
before compressToUint8Array
and new Buffer('data', 'hex')
after decompressFromUint8Array
, which is far from optimal.
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
How Compress TypedArrays/ArrayBuffers for storage and ...
It returns an Uint8Array which can be converted to a Blob or ArrayBuffer for storage with f.ex. IndexedDB or transferred over the net....
Read more >Compress & Decompress An ArrayBuffer Client Side in JS
Compress & Decompress An ArrayBuffer Client Side in JS ... API is new and up and coming way to compress and decompress data...
Read more >superbuffer - npm
A simple way to serialize JavaScript objects into ArrayBuffers for high compression on the wire.. Latest version: 1.1.0, last published: a ...
Read more >Compression Streams
8.1 Gzip-compress a stream; 8.2 Deflate-compress an ArrayBuffer to a Uint8Array; 8.3 Gzip-decompress a Blob to Blob.
Read more >Compression and Decompression of Data Using Zlib in Node.js
Zlib Properties and Methods · buffer: It can be of type Buffer, TypedArray, DataView, ArrayBuffer, and string. · options: It is an optional ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Moving directly from/to ArrayBuffer to “valid” UTF-16 strings would be very helpful in my use case, so I look forward to suggestions on this.
Other libraries are huge, which makes them not very good for using in browsers, this is the primary reason for me to use this library