admin管理员组文章数量:1315826
I am trying to get LZ4 depression to work client-side in pure JavaScript.
I found this JavaScript library but it's meant to be used with Node.js. Within the same repository I found a library which can in theory be used in the browser. The problem is that such library expects still Node.js buffers which again I don't have since I'm not using Node.js and all of this is happening client side (I logged a bug here to try and get a hold of some pointers for how to use it).
I then looked for a porting of Node.js buffers and I found this repository. The problem is that when I use it I get this error in both Chrome and Firefox:
TypeError: this is not a typed array
I logged this bug report for this. I feel like bining those two libraries I am not too far from achieving lz4 depression in pure JavaScript but having never worked before with ArrayBuffer, Uint8Array and Node.js I am struggling to connect the dots.
My question: Has anyone successfully managed to depress LZ4 in pure JavaScript? Any advice or pointers? Thanks in advance.
I am trying to get LZ4 depression to work client-side in pure JavaScript.
I found this JavaScript library but it's meant to be used with Node.js. Within the same repository I found a library which can in theory be used in the browser. The problem is that such library expects still Node.js buffers which again I don't have since I'm not using Node.js and all of this is happening client side (I logged a bug here to try and get a hold of some pointers for how to use it).
I then looked for a porting of Node.js buffers and I found this repository. The problem is that when I use it I get this error in both Chrome and Firefox:
TypeError: this is not a typed array
I logged this bug report for this. I feel like bining those two libraries I am not too far from achieving lz4 depression in pure JavaScript but having never worked before with ArrayBuffer, Uint8Array and Node.js I am struggling to connect the dots.
My question: Has anyone successfully managed to depress LZ4 in pure JavaScript? Any advice or pointers? Thanks in advance.
Share Improve this question edited Dec 13, 2013 at 16:13 Mike Vella 10.6k15 gold badges61 silver badges91 bronze badges asked Dec 13, 2013 at 15:47 TarelliTarelli 6347 silver badges18 bronze badges1 Answer
Reset to default 7I will provide an IDEA not a solution, you can try this repository
https://code.google./p/lz4/
it has a pure c implementation of LZ4
you can pile that with clang to llvm bitcode
and when you have that, you use this https://github./kripken/emscripten
to get javascript out of the llvm bitcode
its like c to javascript pilation, it maybe sound crazy but if you look at what they already achieved... i dont know it could actually work.
take a look here they ported lots of things to javascript with this tool for example this one: https://github./kripken/lzma.js
本文标签: Using lz4 compression in javascript without NodejsStack Overflow
版权声明:本文标题:Using lz4 compression in javascript without Node.js - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741986286a2408699.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论