question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compressing Buffer/Uint8Array

See original GitHub issue

I 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:open
  • Created 6 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Dessixcommented, Aug 15, 2017

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.

1reaction
nazar-pccommented, Jul 20, 2017

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found